jedis icon indicating copy to clipboard operation
jedis copied to clipboard

Pipelined transaction-handling: watch + get & multi + set

Open sebdehne opened this issue 11 months ago • 0 comments

Pipelined transaction

A typical transaction looks like:

WATCH foo
GET foo
MULTI
SET foo bar
EXEC

(five round trips if executed separately)

But it would be more efficient to be able to pipeline those commands like:

WATCH foo\r\nGET foo\r\n

and then

MULTI\r\nSET foo bar\r\nEXEC

resulting in just two round trips. The protocol supports this, but I could not find any support in Jedis for this. Is it possible to add?

Thanks

sebdehne avatar Feb 27 '24 21:02 sebdehne