mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
13 lines
248 B
Ruby
13 lines
248 B
Ruby
class EchoChannel < ActionCable::Channel::Base
|
|
def subscribed
|
|
stream_from "global"
|
|
end
|
|
|
|
def ding(data)
|
|
transmit(dong: data['message'])
|
|
end
|
|
|
|
def bulk(data)
|
|
ActionCable.server.broadcast "global", wide: data['message']
|
|
end
|
|
end
|