Sha256: c8ce4c6e2fef3494342ed134c01f6c7ee7e3958fb75161b71a2001137361e25e

Contents?: true

Size: 319 Bytes

Versions: 2

Compression:

Stored size: 319 Bytes

Contents

class ChatBroadcasterJob < ApplicationJob
   queue_as :default

   def perform(chat)
      ActionCable.server.broadcast "chat_rooms_channel",
         chat: render_message(chat)
   end

   private

   def render_message(chat)
      ChatsController.render partial: 'chats/chat',
         locals: {chat: chat}
   end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
veritrans-2.3.0 example/rails/cable/app/jobs/chat_broadcaster_job.rb
veritrans-2.2.0 example/rails/cable/app/jobs/chat_broadcaster_job.rb