Skip to content

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

Merged
WyriHaximus merged 3 commits into
friends-of-reactphp:masterfrom
clue-labs:idle
Nov 11, 2018

Conversation

@clue

@clue clue commented Nov 11, 2018

Copy link
Copy Markdown
Contributor

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