Callback invocation on bucket reset
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 ?
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