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

Simplify API, add new RedisClient and remove Factory #129

Merged
merged 1 commit into from
May 24, 2022

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