You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"web_notifications_#{current_user.id}", { title:'New things!', body:'All the news that is fit to print' }
216
216
```
217
217
218
-
The `ActionCable.server.broadcast` call places a message in the Redis' pubsub queue under a separate broadcasting name for each user. For a user with an ID of 1, the broadcasting name would be `web_notifications_1`.
218
+
The `ActionCable.server.broadcast` call places a message in the Action Cable pubsub queue under a separate broadcasting name for each user. For a user with an ID of 1, the broadcasting name would be `web_notifications_1`.
219
219
The channel has been instructed to stream everything that arrives at `web_notifications_1` directly to the client by invoking the
220
220
`#received(data)` callback. The data is the hash sent as the second parameter to the server-side broadcast call, JSON encoded for the trip
221
221
across the wire, and unpacked for the data argument arriving to `#received`.
@@ -234,7 +234,7 @@ class ChatChannel < ApplicationCable::Channel
234
234
end
235
235
```
236
236
237
-
Pass an object as the first argument to `subscriptions.create`, and that object will become your params hash in your cable channel. The keyword `channel` is required.
237
+
If you pass an object as the first argument to `subscriptions.create`, that object will become the params hash in your cable channel. The keyword `channel` is required.
238
238
239
239
```coffeescript
240
240
# Client-side, which assumes you've already requested the right to send web notifications
@@ -293,7 +293,7 @@ The rebroadcast will be received by all connected clients, _including_ the clien
293
293
294
294
### More complete examples
295
295
296
-
See the [rails/actioncable-examples](http://github.com/rails/actioncable-examples) repository for a full example of how to setup Action Cable in a Rails app and adding channels.
296
+
See the [rails/actioncable-examples](http://github.com/rails/actioncable-examples) repository for a full example of how to setup Action Cable in a Rails app, and how to add channels.
The second option is to pass the server url through the `action_cable_meta_tag` in your layout.
350
350
This uses a url or path typically set via `config.action_cable.url` in the environment configuration files, or defaults to "/cable".
351
351
352
-
This method is especially useful if your websocket url might change between environments. If you host your production server via https, you will need to use the wss scheme
352
+
This method is especially useful if your WebSocket url might change between environments. If you host your production server via https, you will need to use the wss scheme
353
353
for your ActionCable server, but development might remain http and use the ws scheme. You might use localhost in development and your
354
354
domain in production.
355
355
356
-
In any case, to vary the websocket url between environments, add the following configuration to each environment:
356
+
In any case, to vary the WebSocket url between environments, add the following configuration to each environment:
357
357
358
358
```ruby
359
359
config.action_cable.url ="ws://example.com:28080"
@@ -440,7 +440,7 @@ The Ruby side of things is built on top of [websocket-driver](https://github.com
440
440
441
441
## Deployment
442
442
443
-
Action Cable is powered by a combination of websockets and threads. All of the
443
+
Action Cable is powered by a combination of WebSockets and threads. All of the
444
444
connection management is handled internally by utilizing Ruby’s native thread
445
445
support, which means you can use all your regular Rails models with no problems
446
446
as long as you haven’t committed any thread-safety sins.
0 commit comments