Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
108328fa
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
108328fa
编写于
7月 09, 2015
作者:
L
Lachlan Sylvester
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update README - fix puma command and requiring environment from cabel/config.ru
上级
7ea5619e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
6 deletion
+6
-6
README.md
README.md
+6
-6
未找到文件。
README.md
浏览文件 @
108328fa
...
...
@@ -15,7 +15,7 @@ websockets open to your application if they use multiple browser tabs or devices
The client of a websocket connection is called the consumer.
Each consumer can in turn subscribe to multiple cable channels. Each channel encapsulates
a logical unit of work, similar to what a controller does in a regular MVC setup. So
a logical unit of work, similar to what a controller does in a regular MVC setup. So
you may have a
`ChatChannel`
and a
`AppearancesChannel`
. The consumer can be subscribed to either
or to both. At the very least, a consumer should be subscribed to one channel.
...
...
@@ -26,7 +26,7 @@ could subscribe to multiple chat rooms at the same time. (And remember that a ph
have multiple consumers, one per tab/device open to your connection).
Each channel can then again be streaming zero or more broadcastings. A broadcasting is a
pubsub link where anything transmitted by the broadcaster is sent directly to the channel
pubsub link where anything transmitted by the broadcaster is sent directly to the channel
subscribers who are streaming that named broadcasting.
As you can see, this is a fairly deep architectural stack. There's a lot of new terminology
...
...
@@ -148,7 +148,7 @@ We then link `App.appearance#appear` to `AppearanceChannel#appear(data)`. This i
channel instance will automatically expose the public methods declared on the class (minus the callbacks), so that these
can be reached as remote procedure calls via
`App.appearance#perform`
.
Finally, we expose
`App.appearance`
to the machinations of the application itself by hooking the
`#appear`
call into the
Finally, we expose
`App.appearance`
to the machinations of the application itself by hooking the
`#appear`
call into the
Turbolinks
`page:change`
callback and allowing the user to click a data-behavior link that triggers the
`#away`
call.
...
...
@@ -234,7 +234,7 @@ application. The recommended basic setup is as follows:
```
ruby
# cable/config.ru
require
::
File
.
expand_path
(
'../config/environment'
,
__FILE__
)
require
::
File
.
expand_path
(
'../
../
config/environment'
,
__FILE__
)
Rails
.
application
.
eager_load!
require
'action_cable/process/logging'
...
...
@@ -245,7 +245,7 @@ run ActionCable.server
Then you start the server using a binstub in bin/cable ala:
```
#!/bin/bash
bundle
exec
puma
cable/config.ru
-p
28080
bundle
exec
puma
-p
28080 cable/config.ru
```
That'll start a cable server on port 28080. Remember to point your client-side setup against that using something like:
...
...
@@ -268,7 +268,7 @@ The Ruby side of things is built on top of [faye-websocket](https://github.com/f
## Deployment
Action Cable is powered by a combination of EventMachine and threads. The
framework plumbing needed for connection handling is handled in the
framework plumbing needed for connection handling is handled in the
EventMachine loop, but the actual channel, user-specified, work is handled
in a normal Ruby thread. This means you can use all your regular Rails models
with no problem, as long as you haven't committed any thread-safety sins.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录