
A consumer can act as a subscriber to a given channelĪny number of times. The connection between the subscriber and the channel is, surprise-surprise,Ĭalled a subscription. When the consumer is subscribed to a channel, they act as a subscriber. At the very least, a consumer should be subscribed For example, you could have a ChatChannel andĪn AppearancesChannel, and a consumer could be subscribed to either Each channelĮncapsulates a logical unit of work, similar to what a controller does inĪ typical MVC setup. 2.3 ChannelsĮach consumer can, in turn, subscribe to multiple channels.

The consumer is created by the client-side JavaScript framework. The client of a WebSocket connection is called the consumer. WebSockets open to your application if they use multiple browser tabs or devices. It has oneĬonnection instance per WebSocket connection. You haveĪccess to your entire domain model written with Active Record or your ORM ofĪction Cable uses WebSockets instead of the HTTP request-response protocol.īoth Action Cable and WebSockets introduce some less familiar terminology: 2.1 ConnectionsĬonnections form the foundation of the client-server relationship.Ī single Action Cable server can handle multiple connection instances. It's a full-stack offering that provides both aĬlient-side JavaScript framework and a server-side Ruby framework. Same style and form as the rest of your Rails application, while still being It allows for real-time features to be written in Ruby in the
