wiremock-state-extension icon indicating copy to clipboard operation
wiremock-state-extension copied to clipboard

Add the global concurrency-safe increment counter

Open oleg-nenashev opened this issue 2 years ago • 3 comments

Proposal

As a user for this plugin, I would like to use global counter, e.g. for IDs or for cursor-alike APIs. To do that, there should be a concurrency-safe increment logic, maybe offered as a handlebars Marco. Other similar methods would be nice as well

As a bonus point, it would be nice to use the storage API to ensure that it remains concurrency-safe even when HA-alike features re used, but I think it is for the future and needs API review together with @tomakehurst

References

No response

oleg-nenashev avatar Oct 09 '23 06:10 oleg-nenashev

I have an almost-ready PR on my laptop that makes use of the storage API. I've still got a couple of tests to fix but I can push it to a branch if anyone's interested in looking.

tomakehurst avatar Oct 09 '23 09:10 tomakehurst

It would be great @tomakehurst ! Do not forget to register for Hacktoberfest too 👼

oleg-nenashev avatar Oct 11 '23 06:10 oleg-nenashev

Just reached this while trying to fix a bug with redundant updates: somehow I either need a lock or a concurrent update mechanism for a store which also works in HA. @tomakehurst if I can support in any way I'm happy to contribute.

dirkbolte avatar Dec 22 '23 14:12 dirkbolte