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

multi() support without requiring external synchronization #2976

Open
Brian1KB opened this issue Aug 26, 2024 · 1 comment
Open

multi() support without requiring external synchronization #2976

Brian1KB opened this issue Aug 26, 2024 · 1 comment
Labels
for: team-attention An issue we need to discuss as a team to make progress status: waiting-for-triage

Comments

@Brian1KB
Copy link

Feature Request

The ability to use multi() or some variant of it without needing to provide external synchronization

Is your feature request related to a problem? Please describe

I have a heavily multi threaded application where I use a single Lettuce connection. Previously, I used Jedis with an Apache Commons GenericObjectPool, and since migrating I've had great performance improvements, and everything is playing nicely with virtual threads. However, I need to use multi(), which means I'll need to either:

A. Synchronize the single connection, however this would result in blocking further commands from being added to the pipeline until the multi/exec is complete

B. Involve a connection pool as mentioned on the wiki, which would result in an increase in complexity, and an increase in latency in instances where new connections to the Redis must be instantiated.

Describe the solution you'd like

Rather than the multi command instantly being added to the command queue, I believe (without understanding the internals involved very well mind you!) that it would make more sense for there to be an additional multi command which would instead return a RedisCommands<K, V> instance itself. Then, you could run your commands on this, and only when you run exec() here would the multi, commands & exec be appended on to the queue on the "true" RedisCommands instance.

Perhaps this is not possible as a result of some technical restriction, but if so I'd love to hear why from someone with a bit more knowledge. Many thanks.

Describe alternatives you've considered

N/a

Teachability, Documentation, Adoption, Migration Strategy

N/a

@dktapps

This comment was marked as off-topic.

@redis redis deleted a comment Aug 26, 2024
@redis redis deleted a comment Aug 26, 2024
@redis redis deleted a comment Aug 26, 2024
@redis redis deleted a comment Aug 26, 2024
@redis redis deleted a comment Aug 26, 2024
@redis redis deleted a comment Aug 26, 2024
@tishun tishun added for: team-attention An issue we need to discuss as a team to make progress status: waiting-for-triage labels Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: team-attention An issue we need to discuss as a team to make progress status: waiting-for-triage
Projects
None yet
Development

No branches or pull requests

5 participants
@Brian1KB @tishun @dktapps and others