Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if the lock is taken #21

Open
rhutanu90 opened this issue Jun 5, 2018 · 7 comments
Open

Check if the lock is taken #21

rhutanu90 opened this issue Jun 5, 2018 · 7 comments

Comments

@rhutanu90
Copy link

Hi! We encountered a situation when we would like to terminate all the calls when a locked call is already in execution (instead of waiting). @malkusch do you plan to extend the library with this feature in the near future? 馃憤

@willemstuursma
Copy link
Contributor

You mean, testing if the lock is taken, and then aborting?

@TheLevti
Copy link
Contributor

TheLevti commented Jun 6, 2018

Same request here. I use predis locks. In some cases I don't want to wait until the lock is released, but abort the request if another process is already holding that lock.

@rhutanu90
Copy link
Author

Yes, check if the lock is taken and if so throw an exception

@willemstuursma willemstuursma changed the title Terminate the call instead of waiting Check if the lock is taken Jun 6, 2018
@willemstuursma
Copy link
Contributor

I don't have any plans to add this feature. However, I'm willing to take in any pull requests that add this feature.

If you want to create a PR for this, please discuss the interface here first.

@tsmgeek
Copy link

tsmgeek commented Jan 3, 2020

If the Loop class had an ability to pass a flag to disable retries or set X retries instead of using timeout this could help this out etc.

@georgegg
Copy link

Hi. I would avoid to introduce a second timeout because funky things might happen. I would suggest the use of a flag to enable/disable the loop to execute more than once or till the locks ttl expire.
Is this thread active or rather do you see value in this feature?

@fredericgboutin-yapla
Copy link

"workaround", use Symfony Lock instead - https://symfony.com/doc/5.x/components/lock.html#usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants