Skip to content

Conversation

clue
Copy link
Owner

@clue clue commented May 24, 2022

This changeset simplifies the API by adding a new RedisClient and removing the existing Factory:

// old
$factory = new Clue\React\Redis\Factory();
$redis = $factory->createLazyClient('localhost:6379');

// new
$redis = new Clue\React\Redis\RedisClient('localhost:6379');

Internally, the RedisClient works similar to what was previously called a "lazy" client, but we're getting rid of this wording altogether. This means it automatically creates the underlying connection to Redis only when it's actually needed and will close this connection after a short while when it is not in use anymore.

A follow-up PR will update the "idle" or "keepalive" time and adjust the open and close event handling as discussed in #118.

Builds on top of #128 and #87
Refs #118

@clue clue added this to the v3.0.0 milestone May 24, 2022
@clue clue requested a review from SimonFrings May 24, 2022 09:02
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.

2 participants