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

Add support for LPOP and BRPOP #774

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

anujphadke
Copy link

Usage -

  1. blpop key [key...] timeout
  2. brpop key [key...] timeout

E.g. -

  1. blpop:
    127.0.1.1:8102> LPUSH test_list how
    (integer) 1
    127.0.1.1:8102> LPUSH test_list are
    (integer) 2
    127.0.1.1:8102> LPUSH test_list you
    (integer) 3
    127.0.1.1:8102> blpop test_list 1
  1. "test_list"
  2. "you"
    127.0.1.1:8102> blpop test_list 1
  3. "test_list"
  4. "are"
    127.0.1.1:8102> blpop test_list 1
  5. "test_list"
  6. "how"
    127.0.1.1:8102> blpop test_list 1
  1. brpop :
    127.0.1.1:8102> LPUSH test_list how
    (integer) 1
    127.0.1.1:8102> LPUSH test_list are
    (integer) 2
    127.0.1.1:8102> LPUSH test_list you
    (integer) 3
    127.0.1.1:8102> brpop test_list 1
  1. "test_list"
  2. "how"
    127.0.1.1:8102> brpop test_list 1
  3. "test_list"
  4. "are"
    127.0.1.1:8102> brpop test_list 1
  5. "test_list"
  6. "you"

anujphadke and others added 2 commits August 5, 2020 16:09
Usage -
1. blpop key [key...] timeout
2. brpop key [key...] timeout

E.g. -

1. blpop:
127.0.1.1:8102> LPUSH test_list how
(integer) 1
127.0.1.1:8102> LPUSH test_list are
(integer) 2
127.0.1.1:8102> LPUSH test_list you
(integer) 3
127.0.1.1:8102> blpop test_list 1
1) "test_list"
2) "you"
127.0.1.1:8102> blpop test_list 1
1) "test_list"
2) "are"
127.0.1.1:8102> blpop test_list 1
1) "test_list"
2) "how"
127.0.1.1:8102> blpop test_list 1

2. brpop :
127.0.1.1:8102> LPUSH test_list how
(integer) 1
127.0.1.1:8102> LPUSH test_list are
(integer) 2
127.0.1.1:8102> LPUSH test_list you
(integer) 3
127.0.1.1:8102> brpop test_list 1
1) "test_list"
2) "how"
127.0.1.1:8102> brpop test_list 1
1) "test_list"
2) "are"
127.0.1.1:8102> brpop test_list 1
1) "test_list"
2) "you"
@wy-ei
Copy link

wy-ei commented May 17, 2021

blpop may block the connection between proxy and Redis, and the connection was reused by many client. This implementation can not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants