redis中實現發佈與訂閱相對於zookeeper很是簡單。直接使用publish和subscribe就行。 redis
subscrible news; 訂閱news這個channelspa
publish news a-dog-eat-a-pig 在news這個channel就接受到信息class