feature suggestion - `region.is_key_locked(key)`

Issue #101 new
jvanasco
created an issue

I wavered on proposing this for a few days, and am leaning towards this idea.

It would be useful for those who are dealing with expensive value generators to query a region and see if an active dogpile lock exists for a given key. (which would then need to be implemented on the backends as well, returning a boolean or perhaps the seconds remaining)

the rationale is that expensive/long-running generators still result in a pileup of processes that are just waiting for a bottleneck to passes. in some known instances, you may want to handle this.

There are other ways around this, I'm using a few myself. This just seems like it would be useful.

Comments (2)

  1. jvanasco reporter

    I don't think this would even hit the dogpile.core files. I think everything would be on cache's region.py and the backends themselves.

    I wanted to bring this up before considering a PR.

  2. Log in to comment