Keep compatibilities as possible for the transaction feature between a standalone client and a cluster client #1267
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are some differences of the interface for the transaction feature between redis gem and redis-client gem. It seems that the redis-client gem is designed to be more simpler than the redis gem.
redis gem:
redis-rb/lib/redis/commands/transactions.rb
Lines 38 to 49 in cdfe172
redis-client gem:
https://github.com/redis-rb/redis-client?tab=readme-ov-file#transactions
On the redis-clustering gem side, I fixed some bugs for the transaction feature, but several compatibilities were broken.
So I tried to implement to keep the compatibility as possible by using an adapter. The adapter fills the interface gap between the redis-clustering gem and the redis-cluster-client gem. Because the cluster client implementation for the transaction feature tends to be complex for the sharding, we are hard to keep the same behaviors between the redis gem and the redis-clustering gem. But I thought it is possible up to a point.