实现

1、list作为队列,rpush生产队列,lpop消费信息,bloop在没有消息的时候会阻塞
2、pub/sub可以实现1:n的消息队列

延时队列

sortedset,时间戳作为score,消息内容作为key调用zadd来生产消息,
用zrangebyscore获取n秒之前的消息。