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

Implement "idle" timeout for LazyConnection to close underlying connection when unused and automatically create new underlying connection on demand again #88

Merged
merged 3 commits into from
Nov 11, 2018

Conversation

clue
Copy link
Contributor

@clue clue commented Nov 11, 2018

By default, the createLazyConnection() method will now keep "idle" connection open for 60s and will
then end the underlying connection. The next request after an "idle"
connection ended will automatically create a new underlying connection.
This ensure you always get a "fresh" connection and as such should not be
confused with a "keepalive" or "heartbeat" mechanism, as this will not
actively try to probe the connection. You can explicitly pass a custom
idle timeout value in seconds (or use a negative number to not apply a
timeout) like this:

$factory->createLazyConnection('localhost?idle=0.1');

Builds on top of #87

@clue clue added this to the v0.5.0 milestone Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants