1.插入队列(生产者)
private static RedisClient client = new RedisClient("127.0.0.1", 6379, null); client.EnqueueItemOnList(listId, valuestr);
2.读取队列(消费者)
private static RedisClient client = new RedisClient("127.0.0.1", 6379, null); 阻塞模式读取 string value = client.BlockingDequeueItemFromList(listId,new TimeSpan(1)); ///非阻塞模式读取 string value = client.DequeueItemFromList(listId);
注.可以开启多个生产者往队列里插入数据,同时可以开启多个消费之从队列里读取数据。