Obvs icon indicating copy to clipboard operation
Obvs copied to clipboard

Callback invocation on bucket reset

Open jfayad opened this issue 8 months ago • 1 comments

I'm looking to see if there is any interest in having the ability to configure a callback that would be invoked whenever a bucket is being reset/cleaned ?

I have a use case where I need to collect the counter's value before it gets reset by the expiry time. In my use case, I want to check if this value should trigger a bill based on resource usage but I can think of other user case where people might want to push these values into telemetry for usage statistics.

Implementing such a callback should have no impact on hit/inc usage as it would happen when processing the cleaning message (on ETS backend).

Before I go ahead an open a PR I would like to know:

  • Is this something that has been considered before ? If yes, why hasn't it been implemented ?
  • Are you foreseeing any reason why it wouldn't be a good idea to go ahead with this feature ?

jfayad avatar May 22 '25 08:05 jfayad

sure! I would be opened to it. sounds like we would need to improve the clean bucket. One of the thing is that not all algorithm work the same but a PR would be nice to start discussing what that looks like

epinault avatar Jul 16 '25 21:07 epinault