视频:

https://gorails.com/episodes/how-actioncable-uses-redis?autoplay=1

原理PubSub, 你进入一个频道,然后就能接收,和发布信息给频道中的所有人。

Redis CLI

假设已经安装redis。在terminal运行:

redis-cli

进入,后输入subscribe "chat"订阅频道:

subscribe "chat"   #'chat'是你定义的频道名字

显示:

Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "chat"
3) (integer) 1

在其他terminal新窗口,多开几个,同样订阅"chat"(和

(GoRails)ActionCable如何用Redis + 菜鸟redis教程的更多相关文章

  1. [个人翻译]Redis 集群教程(中)

    上一篇:http://www.cnblogs.com/li-peng/p/6143709.html 官方原文地址:https://redis.io/topics/cluster-tutorial  水 ...

  2. Redis使用详细教程

    Redis使用详细教程 一.Redis基础部分: 1.redis介绍与安装比mysql快10倍以上 *****************redis适用场合**************** 1.取最新N个 ...

  3. [个人翻译]Redis 集群教程(下)

    [个人翻译]Redis 集群教程(上) [个人翻译]Redis 集群教程(中) 官方原文地址:https://redis.io/topics/cluster-tutorial 水平有限,如果您在阅读过 ...

  4. ssm 整合 redis(进阶教程)

    最后我建议大家使用 Spring StringRedisTemplate 配置,参阅: http://blog.csdn.net/hanjun0612/article/details/78131333 ...

  5. springboot+shiro+redis(单机redis版)整合教程-续(添加动态角色权限控制)

    相关教程: 1. springboot+shiro整合教程 2. springboot+shiro+redis(单机redis版)整合教程 3. springboot+shiro+redis(集群re ...

  6. springboot+shiro+redis(集群redis版)整合教程

    相关教程: 1. springboot+shiro整合教程 2. springboot+shiro+redis(单机redis版)整合教程 3.springboot+shiro+redis(单机red ...

  7. springboot+shiro+redis(单机redis版)整合教程

    相关教程: 1. springboot+shiro整合教程 2. springboot+shiro+redis(集群redis版)整合教程 3.springboot+shiro+redis(单机red ...

  8. Java工程师之Redis实战系列教程前言&目录

    系列前言 Java工程师之Redis实战系列教程,同其他教程一样,均是在下学习笔记,本系列主要参考自<Redis-in-action>,将书本中的有趣的例子转化为能解决特定问题的示例程序, ...

  9. Redis使用详细教程【转】

    转自 Redis使用详细教程 - wangyuyu - 博客园http://www.cnblogs.com/wangyuyu/p/3786236.html 一.Redis基础部分: 1.redis介绍 ...

随机推荐

  1. [Jenkins] 批量删除构建历史

    Manage Jenkins -> Script Console def jobName = "Some_Job_Name" def maxNumber = 64 Jenki ...

  2. 170703、springboot编程之模板使用(thymeleaf、freemarker)

    官方不推荐集成jsp,关于使用jsp模板我这里就不赘述,如果有需要的,请自行百度! thymeleaf的使用 1.在pom中增加thymeleaf支持 <dependency> <g ...

  3. JS将阿拉伯数字转为钱

     function DX(n) {         if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n))             return "数据非法" ...

  4. HOJ 2317 Pimp My Ride(状态压缩DP)

    Pimp My Ride My Tags (Edit) Source : TUD 2005 Time limit : 3 sec Memory limit : 64 M Submitted : 63, ...

  5. Git Bash关键命令

    1.默认目录是C:\Users\用户名 2.切换目录:$cd c:\\windows 3.切换到上级目录:cd ..,中间有空格 4.列出某目录所有文件,相当于DOS下的dir:ls c:\\wind ...

  6. 向Docx4j生成的word文档中添加布局--第二部分

    原文标题:Adding layout to your Docx4j-generated word documents, part 2 原文链接:http://blog.iprofs.nl/2012/1 ...

  7. android中Logcat的TAG过滤

    如果代码中有这样的log: Log.e("Foo", "error in foo"); Log.d("Foo", "debug i ...

  8. ERROR 2002 (HY000): Can't connect to local MySQL server through socket

    原文链接:https://blog.csdn.net/u011262253/article/details/82802157 一.错误现场还原: 下面我们通过三种方式来连接,然后观察提示的错误信息: ...

  9. Mysql varchar 把默认值设置为null和空的区别

    '\0',这个表示空,需要消耗存储空间的.NULL,则表示连这个\0都没有. NULL,你可以近似理解为变量未赋值(定义了变量,但是未使用,变量不指向具体存储空间,因此,理论上不消耗存储空间),同时, ...

  10. Python扩展之类的魔术方法

    Python中类的魔术方法 在Python中以两个下划线开头的方法,__init__.__str__.__doc__.__new__等,被称为"魔术方法"(Magic method ...