 module ActionCabl8b7c:f320:99b9:690f:4595:cd17:293a:c069Server8b7c:f320:99b9:690f:4595:cd17:293a:c069roadcasting   Broadcasting is how other parts of your application can send messages to a channel's subscribers. As explained in Channel, most of the time, these broadcastings are streamed directly to the clients subscribed to the named broadcasting. Let's explain with a full-stack example: class WebNotificationsChannel < ApplicationCabl8b7c:f320:99b9:690f:4595:cd17:293a:c069Channel
  def subscribed
    stream_from "web_notifications_#{current_user.id}"
  end
end

# Somewhere in your app this is called, perhaps from a NewCommentJob:
ActionCable.server.broadcast \
  "web_notifications_1", { title: "New things!", body: "All that's fit for print" }

# Client-side CoffeeScript, which assumes you've already requested the right to send web notifications:
App.cable.subscriptions.create "WebNotificationsChannel",
  received: (data) ->
    new Notification data['title'], body: data['body']     Public Instance Methods    broadcast(broadcasting, message, coder: ActiveSupport8b7c:f320:99b9:690f:4595:cd17:293a:c069JSON) Show source  
 # File actioncable/lib/action_cable/server/broadcasting.rb, line 22
def broadcast(broadcasting, message, coder: ActiveSupport8b7c:f320:99b9:690f:4595:cd17:293a:c069JSON)
  broadcaster_for(broadcasting, coder: coder).broadcast(message)
end  Broadcast a hash directly to a named broadcasting. This will later be JSON encoded.     broadcaster_for(broadcasting, coder: ActiveSupport8b7c:f320:99b9:690f:4595:cd17:293a:c069JSON) Show source  
 # File actioncable/lib/action_cable/server/broadcasting.rb, line 28
def broadcaster_for(broadcasting, coder: ActiveSupport8b7c:f320:99b9:690f:4595:cd17:293a:c069JSON)
  Broadcaster.new(self, String(broadcasting), coder: coder)
end  Returns a broadcaster for a named broadcasting that can be reused. Useful when you have an object that may need multiple spots to transmit to a specific broadcasting over and over.    

    
{'path': 'public/docs/rails~5.1/actioncable/server/broadcasting.html', 'source': 'DevDocs.IO'}