Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
71657146
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,发现更多精彩内容 >>
提交
71657146
编写于
4月 18, 2016
作者:
V
Vipul A M
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #24600 from tomkadwill/action-cabel-channel-typos
Fix typos in ActionCable Channel [ci skip]
上级
2ab7c22a
2ef18c1e
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
5 addition
and
5 deletion
+5
-5
actioncable/README.md
actioncable/README.md
+1
-1
actioncable/lib/action_cable/channel/periodic_timers.rb
actioncable/lib/action_cable/channel/periodic_timers.rb
+2
-2
actioncable/lib/action_cable/channel/streams.rb
actioncable/lib/action_cable/channel/streams.rb
+1
-1
actioncable/lib/action_cable/connection/base.rb
actioncable/lib/action_cable/connection/base.rb
+1
-1
未找到文件。
actioncable/README.md
浏览文件 @
71657146
...
...
@@ -178,7 +178,7 @@ App.cable.subscriptions.create "AppearanceChannel",
```
Simply calling
`App.cable.subscriptions.create`
will setup the subscription, which will call
`AppearanceChannel#subscribed`
,
which in turn is linked to original
`App.cable`
->
`ApplicationCable::Connection`
instances.
which in turn is linked to
the
original
`App.cable`
->
`ApplicationCable::Connection`
instances.
Next, we link the client-side
`appear`
method to
`AppearanceChannel#appear(data)`
. This is possible because the server-side
channel instance will automatically expose the public methods declared on the class (minus the callbacks), so that these
...
...
actioncable/lib/action_cable/channel/periodic_timers.rb
浏览文件 @
71657146
...
...
@@ -12,8 +12,8 @@ module PeriodicTimers
end
module
ClassMethods
# Allows you to call a private method
<tt>every</tt> so often seconds. This periodic timer can be useful
# for sending a steady flow of updates to a client based off an object that was configured on subscription.
# Allows you to call a private method
periodically. Specify the period, in seconds, using the <tt>every</tt> keyword argument.
#
This periodic timer can be useful
for sending a steady flow of updates to a client based off an object that was configured on subscription.
# It's an alternative to using streams if the channel is able to do the work internally.
def
periodically
(
callback
,
every
:)
self
.
periodic_timers
+=
[
[
callback
,
every:
every
]
]
...
...
actioncable/lib/action_cable/channel/streams.rb
浏览文件 @
71657146
...
...
@@ -2,7 +2,7 @@ module ActionCable
module
Channel
# Streams allow channels to route broadcastings to the subscriber. A broadcasting is, as discussed elsewhere, a pubsub queue where any data
# placed into it is automatically sent to the clients that are connected at that time. It's purely an online queue, though. If you're not
# streaming a broadcasting at the very moment it sends out an update, you will not get that update, if you connect after it has been sent.
# streaming a broadcasting at the very moment it sends out an update, you will not get that update,
even
if you connect after it has been sent.
#
# Most commonly, the streamed broadcast is sent straight to the subscriber on the client-side. The channel just acts as a connector between
# the two parties (the broadcaster and the channel subscriber). Here's an example of a channel that allows subscribers to get all new
...
...
actioncable/lib/action_cable/connection/base.rb
浏览文件 @
71657146
...
...
@@ -40,7 +40,7 @@ module Connection
# Second, we rely on the fact that the WebSocket connection is established with the cookies from the domain being sent along. This makes
# it easy to use signed cookies that were set when logging in via a web interface to authorize the WebSocket connection.
#
# Finally, we add a tag to the connection-specific logger with name of the current user to easily distinguish their messages in the log.
# Finally, we add a tag to the connection-specific logger with
the
name of the current user to easily distinguish their messages in the log.
#
# Pretty simple, eh?
class
Base
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录