BLPOP/BRPOP confusion in Protocol

70 views
Skip to first unread message

Robert DiFalco

unread,
Oct 8, 2014, 11:36:32 AM10/8/14
to jedis...@googlegroups.com
I'm not sure I understand how Jedis maps BLPOP/BRPOP to REDIS.

For example, consider these two methods:

    public List<String> blpop(String arg)
    public List<String> blpop(String... args)

No timeout is specified. This seems to be handled in the client layer as:

    public List<String> blpop(int timeout, String... args) {

So here's my question. The first two that don't take a timeout, what is the intended behavior? Is a zero timeout implied? In REDIS this is a required parameter but it is not in Jedis. Also what is the result of the following:

    jedis.blpop(1, "1");
    jedis.blpop("1");
    jedis.blpop("2", "1");

In the last example will "1" be interpreted as a key or as a timeout?

Thanks!


Robert DiFalco

unread,
Oct 8, 2014, 11:41:50 AM10/8/14
to jedis...@googlegroups.com
Back from a couple of unit tests. It doesn't even seem like blpop with one string parameter is allowed, it gives an error. So why is it even defined in the command layer?

임정택

unread,
Oct 11, 2014, 1:58:47 AM10/11/14
to jedis...@googlegroups.com
Hello, Robert.

It seems to a bug. Could you report it to Github?
Btw, maybe we should clean up invalid commands from current Jedis.

Thanks!

Regards.
Jungtaek Lim (HeartSaVioR)


2014년 10월 9일 목요일 오전 12시 41분 50초 UTC+9, Robert DiFalco 님의 말:
Reply all
Reply to author
Forward
0 new messages