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

Support cloning RedisClient instance #172

Merged
merged 1 commit into from
Feb 22, 2025
Merged

Conversation

clue
Copy link
Owner

@clue clue commented Feb 15, 2025

This changeset adds support for cloning an existing RedisClient instance using the clone keyword:

$original = new Clue\React\Redis\RedisClient($uri);
$redis = clone $original;

This can be especially useful if the original connection is used for a PubSub subscription or when using blocking commands or similar and you need a control connection that is not affected by any of this.

The implementation is relatively straight-forward. Major effort went into documenting this feature thoroughly and testing to avoid any unintended side effects. If you enjoy this work, consider supporting this project, for example by becoming a sponsor ❤️

Builds on top of #166, #163, #129 and others
Refs #118

@clue
Copy link
Owner Author

clue commented Feb 22, 2025

Rebased to resolve unrelated build error now that #173 is merged :shipit:

@clue clue requested a review from PaulRotmann February 22, 2025 12:29
Copy link
Collaborator

@PaulRotmann PaulRotmann left a comment

Choose a reason for hiding this comment

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

Now that the tests run, the change LGTM.

@PaulRotmann PaulRotmann merged commit 5533a0c into clue:3.x Feb 22, 2025
18 checks passed
@clue clue deleted the clone branch February 22, 2025 12:36
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