Class: Legion::Transport::Messages::Dynamic
- Inherits:
-
Legion::Transport::Message
- Object
- Legion::Transport::Message
- Legion::Transport::Messages::Dynamic
- Defined in:
- lib/legion/transport/messages/dynamic.rb
Constant Summary
Constants inherited from Legion::Transport::Message
Legion::Transport::Message::ENVELOPE_KEYS
Constants included from Common
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
Methods inherited from Legion::Transport::Message
#app_id, #channel, #content_encoding, #content_type, #correlation_id, #encode_message, #encrypt?, #encrypt_message, #exchange_name, #expiration, #headers, #initialize, max_payload_bytes, #message_id, #persistent, #priority, #publish, #reply_to, #timestamp, #user_id, #validate
Methods included from Common
#channel, #channel_open?, #close, #close!, #deep_merge, #generate_consumer_tag, #open_channel, #options_builder
Constructor Details
This class inherits a constructor from Legion::Transport::Message
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/legion/transport/messages/dynamic.rb', line 5 def @options end |
Instance Method Details
#exchange ⇒ Object
22 23 24 |
# File 'lib/legion/transport/messages/dynamic.rb', line 22 def exchange Legion::Transport::Exchange.new(function.runner.extension.values[:exchange]) end |
#function ⇒ Object
26 27 28 |
# File 'lib/legion/transport/messages/dynamic.rb', line 26 def function @function ||= Legion::Data::Model::Function[@options[:function_id]] end |
#message ⇒ Object
11 12 13 14 |
# File 'lib/legion/transport/messages/dynamic.rb', line 11 def { args: @options[:args] || @options, function: function.values[:name] } end |
#routing_key ⇒ Object
16 17 18 19 20 |
# File 'lib/legion/transport/messages/dynamic.rb', line 16 def routing_key key = "#{function.runner.extension.values[:name]}.#{function.runner.values[:name]}.#{function.values[:name]}" log.debug "Dynamic routing_key=#{key} function_id=#{@options[:function_id]}" key end |
#type ⇒ Object
7 8 9 |
# File 'lib/legion/transport/messages/dynamic.rb', line 7 def type 'task' end |