Class: Legion::LLM::Transport::Messages::FleetRequest
Constant Summary
collapse
- PRIORITY_MAP =
{ critical: 9, high: 7, normal: 5, low: 2 }.freeze
Legion::LLM::Transport::Message::LLM_ENVELOPE_KEYS
Instance Method Summary
collapse
#app_id, #correlation_id, #headers, #message_context, #message_id, #tracing_headers
Instance Method Details
#expiration ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/legion/llm/transport/messages/fleet_request.rb', line 21
def expiration
ttl = @options[:ttl]
return super if ttl.nil? || ttl.to_s.strip.empty?
ttl_seconds = Float(ttl)
return super unless ttl_seconds.positive?
(ttl_seconds * 1000).ceil.to_s
rescue ArgumentError, TypeError => e
handle_exception(e, level: :warn, handled: true, operation: 'llm.fleet_request.expiration', ttl: ttl)
super
end
|
#message ⇒ Object
34
35
36
|
# File 'lib/legion/llm/transport/messages/fleet_request.rb', line 34
def message
super.merge(reply_to: reply_to, correlation_id: correlation_id).compact
end
|
#priority ⇒ Object
19
|
# File 'lib/legion/llm/transport/messages/fleet_request.rb', line 19
def priority = map_priority(@options[:priority])
|
#publish(options = nil) ⇒ Object
38
39
40
|
# File 'lib/legion/llm/transport/messages/fleet_request.rb', line 38
def publish(options = nil)
super(default_publish_options.merge(options || {}))
end
|
#reply_to ⇒ Object
18
|
# File 'lib/legion/llm/transport/messages/fleet_request.rb', line 18
def reply_to = @options[:reply_to]
|
#routing_key ⇒ Object
17
|
# File 'lib/legion/llm/transport/messages/fleet_request.rb', line 17
def routing_key = @options[:routing_key]
|
#type ⇒ Object
15
|
# File 'lib/legion/llm/transport/messages/fleet_request.rb', line 15
def type = 'llm.fleet.request'
|