zoukankan      html  css  js  c++  java
  • Redis 发布和订阅

    PS C:Windowssystem32> d:
    PS D:> cd D:SoftWareRedisCmd
    PS D:SoftWareRedisCmd> . edis-cli
    127.0.0.1:6379> auth 12345
    OK

     subscribe channel1  订阅一个频道

     再开一个客户端,发布消息

     publish channel1 hello  向channel1 中发送hello 

     结果:基本就是实时接收到的

     继续发送hello2和hello3

     接收方:

     这里订阅了两个频道 channel1和channel2

     这里先给channel1 发了一个hello  再给channel2发了一个nihao  ,订阅者都收到了

     我又开了一个cmd,又订阅了这个频道,看看一个publish  这俩订阅是不是都可以收到,

    果然,Good

    人各有命,上天注定,有人天生为王,有人落草为寇。脚下的路,如果不是你自己的选择,那么旅程的终点在哪,也没人知道。你会走到哪,会遇到谁,都不一定。
  • 相关阅读:
    Effective C++:条款14:在中小企业资源管理copying表现
    Linux在iptables教程基本应用防火墙
    C++内存分配和拷贝构造函数写研究
    Codeforces 479E Riding in a Lift(dp)
    Swift
    Swift
    Swift
    Swift
    Swift
    Swift
  • 原文地址:https://www.cnblogs.com/ZkbFighting/p/15165643.html
Copyright © 2011-2022 走看看