redis / jedis

Redis Java client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

sebdehne opened this issue · 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