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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lock] Add max wait time to acquire #54942

Open
thedomeffm opened this issue May 16, 2024 · 0 comments
Open

[Lock] Add max wait time to acquire #54942

thedomeffm opened this issue May 16, 2024 · 0 comments

Comments

@thedomeffm
Copy link

Description

The acquiring of a lock can be "blocking" (which is false by default).

Similiar to the ttl parameter of the lock I would love to see a "maxWaitTime" on acquire (only used when "blocking: true")

e.g.

$lock = $factory->createLock('pdf-creation');
$lock->acquire(blocking: true, blockingMaxWaitTime: 20 /*seconds*/);

When the lock could not be acquired in 20 seconds a LockAcquiringException is thrown.

Example

No response

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

No branches or pull requests

3 participants