Home  >  Q&A  >  body text

redis阻塞队列的实现

业务需要,Redis如何高效的实现阻塞队列?
Redis似乎没有像java中linkedblocking queue那样的实现,
只有blpop的阻塞版本,入队的操作需要自己控制阻塞吗

巴扎黑巴扎黑2759 days ago688

reply all(2)I'll reply

  • 阿神

    阿神2017-04-24 09:14:45

    The blocking queue is blocked when leaving the queue, but there is no blocking when entering the queue. BLPOP and Java's BlockingQueue are similar in use.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-24 09:14:45

    Since the queue length of Redis is infinite, joining the queue must be successful, and there is no such thing as queue joining blocking.
    And leaving the queue is blocked

    reply
    0
  • Cancelreply