blob: 38c56b8262f63786e5c3416181889cbcb5a7f6cc (
plain) (
tree)
|
|
module ActionCable
class Broadcaster
attr_reader :server, :channel, :redis
delegate :logger, to: :server
def initialize(server, channel)
@server = server
@channel = channel
@redis = @server.threaded_redis
end
def broadcast(message)
redis.publish channel, message.to_json
logger.info "[ActionCable] Broadcasting to channel (#{channel}): #{message}"
end
end
end
|