jedis
jedis copied to clipboard
Pipelined transaction-handling: watch + get & multi + set
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