Skip to content

Add Timeout Support to PostgreSQLMutex #80

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

colemanator
Copy link

Add support for timeouts to PostgresSQLMutex, as mentioned in this issue #66 PostgreSQL supports a non-blocking advisory lock function.

We've needed this a few times and previously I've rolled our own lock/mutex but it'd be easier if it was in the package. Happy to work through any feedback on this one, tried to follow existing patterns, if I missed anything let me know.

@colemanator colemanator force-pushed the support_postgresql_timeout branch from 0204814 to a9f8890 Compare July 8, 2025 01:34
@colemanator colemanator marked this pull request as ready for review July 8, 2025 01:43
public function __construct(\PDO $PDO, string $name)
private ?float $timeout;

public function __construct(\PDO $PDO, string $name, ?float $timeout = null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@colemanator colemanator force-pushed the support_postgresql_timeout branch from 4143853 to 7ee091e Compare July 11, 2025 03:00
@colemanator colemanator requested a review from mvorisek July 11, 2025 03:09
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

Successfully merging this pull request may close these issues.

2 participants