Class: Ragdoll::FileProcessingChannel

Inherits:
ApplicationCable::Channel show all
Defined in:
app/channels/ragdoll/file_processing_channel.rb

Instance Method Summary collapse

Instance Method Details

#subscribedObject



5
6
7
8
9
# File 'app/channels/ragdoll/file_processing_channel.rb', line 5

def subscribed
  stream_from "ragdoll_file_processing_#{params[:session_id]}"
  puts "📡 Ragdoll::FileProcessingChannel subscribed to ragdoll_file_processing_#{params[:session_id]}"
  logger.info "📡 Ragdoll::FileProcessingChannel subscribed to ragdoll_file_processing_#{params[:session_id]}"
end

#test_connectionObject



16
17
18
19
20
21
22
23
24
# File 'app/channels/ragdoll/file_processing_channel.rb', line 16

def test_connection
  puts "🏓 Received test_connection ping from session: #{params[:session_id]}"
  logger.info "🏓 Received test_connection ping from session: #{params[:session_id]}"
  ActionCable.server.broadcast("ragdoll_file_processing_#{params[:session_id]}", {
    type: 'ping',
    message: 'Connection test successful',
    timestamp: Time.current.to_f
  })
end

#unsubscribedObject



11
12
13
14
# File 'app/channels/ragdoll/file_processing_channel.rb', line 11

def unsubscribed
  puts "📡 Ragdoll::FileProcessingChannel unsubscribed from ragdoll_file_processing_#{params[:session_id]}"
  logger.info "📡 Ragdoll::FileProcessingChannel unsubscribed from ragdoll_file_processing_#{params[:session_id]}"
end