Skip to content

Commit

Permalink
release notes: add Rails whispering
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Apr 1, 2024
1 parent e6a6881 commit ef137d3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
26 changes: 25 additions & 1 deletion docs/misc/action_cable_protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,30 @@ The `restored` flag indicates whether the session state has been restored. **NOT

The optional `restored_ids` field contains the list of channel identifiers that has been re-subscribed automatically at the server side. The client MUST NOT try to resubscribe to the specified channels and consider them connected. It's recommended to perform `history` requests for all the restored channels to catch up with the messages.

### New command: `pong` <img class='pro-badge' src='/assets/new.svg' alt='new' />
### New command: `pong`

The `pong` command MAY be sent in response to the `ping` message if the server requires pongs. It could be used to improve broken connections detection.

### New command: `whisper` <img class='pro-badge' src='/assets/new.svg' alt='new' />

The `whisper` can be used to publish broadcast messages from the client (if the whisper stream has been configured for it) to a particular _channel_.

The payload MUST contain `command` ("whisper"), `identifier` fields, and `data` fields.

The `data` field MAY contain a string or an object.

For example:

```json
{
"identifier": "{\"channel\":\"ChatChannel\",\"id\":42}",
"command": "whisper",
"data": {
"event":"typing",
"user":"Jack"
}
}
```

**IMPORTANT**: Unlike actions (`message` command), the data is not JSON-serialized. It's broadcasted to connected clients as is.

6 changes: 6 additions & 0 deletions docs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ This page contains combined release notes for major and minor releases of all An

See [docs](/rails/extensions?id=broadcast-to-objects).

- Whispering support.

You can specify the whispering stream (for client-initiated broadcasts) by using the `#stream_from(..., whisper: true)` or `#stream_for(..., whisper: true)` in your channel classes.

See [docs](/rails/extensions?id=whispering).

- Added `rails g anycable:bin`.

This generator creates a `bin/anycable-go` script to run (and install) AnyCable server locally.
Expand Down

0 comments on commit ef137d3

Please sign in to comment.