Class: Legion::Gaia::Router::Transport::Messages::InputFrameMessage

Inherits:
Transport::Message
  • Object
show all
Defined in:
lib/legion/gaia/router/transport/messages/input_frame_message.rb

Instance Method Summary collapse

Instance Method Details

#exchangeObject



9
10
11
# File 'lib/legion/gaia/router/transport/messages/input_frame_message.rb', line 9

def exchange
  Legion::Transport::Exchanges::Agent
end

#messageObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/legion/gaia/router/transport/messages/input_frame_message.rb', line 18

def message
  frame = @options[:frame]
  return @options.except(:worker_id, :frame) unless frame

  {
    id: frame.id,
    content: frame.content,
    content_type: frame.content_type,
    channel_id: frame.channel_id,
    channel_capabilities: frame.channel_capabilities,
    device_context: frame.device_context,
    session_continuity_id: frame.session_continuity_id,
    auth_context: frame.auth_context,
    metadata: frame.,
    received_at: frame.received_at.to_s
  }
end

#routing_keyObject



13
14
15
16
# File 'lib/legion/gaia/router/transport/messages/input_frame_message.rb', line 13

def routing_key
  worker_id = @options[:worker_id] || 'default'
  "agent.#{worker_id}"
end

#typeObject



36
37
38
# File 'lib/legion/gaia/router/transport/messages/input_frame_message.rb', line 36

def type
  'input_frame'
end