Class: Legion::LLM::Transport::Messages::FleetResponse

Inherits:
Legion::LLM::Transport::Message show all
Defined in:
lib/legion/llm/transport/messages/fleet_response.rb

Constant Summary

Constants inherited from Legion::LLM::Transport::Message

Legion::LLM::Transport::Message::LLM_ENVELOPE_KEYS

Instance Method Summary collapse

Methods inherited from Legion::LLM::Transport::Message

#app_id, #correlation_id, #message, #message_context, #message_id, #tracing_headers

Instance Method Details

#expirationObject



15
# File 'lib/legion/llm/transport/messages/fleet_response.rb', line 15

def expiration  = nil

#headersObject



17
18
19
# File 'lib/legion/llm/transport/messages/fleet_response.rb', line 17

def headers
  super.merge(tracing_headers)
end

#priorityObject



14
# File 'lib/legion/llm/transport/messages/fleet_response.rb', line 14

def priority    = 0

#publish(options = nil) ⇒ Object

Override publish to use the AMQP default exchange (”). The base class’s publish calls exchange.publish(…), but the default exchange is accessed via channel.default_exchange in Bunny.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/legion/llm/transport/messages/fleet_response.rb', line 24

def publish(options = nil)
  raise unless @valid

  publish_options = @options.merge(reply_publish_defaults).merge(options || {})
  publish_options[:routing_key] = routing_key
  validate_payload_size
  exchange_dest = channel.default_exchange
  return_state = {}
  install_return_listener(exchange_dest, publish_options, return_state)
  prepare_publisher_confirms(exchange_dest, publish_options)
  exchange_dest.publish(encode_message, **publish_envelope_options(publish_options))
  publish_result(exchange_dest, publish_options, return_state)
rescue Bunny::ConnectionClosedError, Bunny::ChannelAlreadyClosed,
       Bunny::NetworkErrorWrapper, IOError, Timeout::Error => e
  publish_failure_result(:failed, e)
end

#routing_keyObject



13
# File 'lib/legion/llm/transport/messages/fleet_response.rb', line 13

def routing_key = @options[:reply_to]

#typeObject



12
# File 'lib/legion/llm/transport/messages/fleet_response.rb', line 12

def type        = 'llm.fleet.response'