class Legion::Extensions::Scheduler::Transport::Messages::SendTask

Public Instance Methods

exchange() click to toggle source
# File lib/legion/extensions/scheduler/transport/messages/send_task.rb, line 24
def exchange
  @exchange ||= if @options.key?(:exchange) && @options[:exchange].is_a?(String)
                  Legion::Transport::Exchange.new(@options[:exchange])
                else
                  Legion::Transport::Exchange.new(function.runner.extension.values[:exchange])
                end
end
function() click to toggle source
# File lib/legion/extensions/scheduler/transport/messages/send_task.rb, line 32
def function
  @function ||= Legion::Data::Model::Function[@options[:function_id]]
end
message() click to toggle source
# File lib/legion/extensions/scheduler/transport/messages/send_task.rb, line 7
def message
  return @options if routing_key == 'task.subtask.transform'

  {
    args: @options[:args] || @options,
    function: function.values[:name]
  }
end
routing_key() click to toggle source
# File lib/legion/extensions/scheduler/transport/messages/send_task.rb, line 16
def routing_key
  @routing_key ||= if @options.key?(:routing_key)
                     @options[:routing_key]
                   else
                     "#{function.runner.extension.values[:name]}.#{function.runner.values[:name]}.#{function.values[:name]}" # rubocop:disable Layout/LineLength
                   end
end
type() click to toggle source
# File lib/legion/extensions/scheduler/transport/messages/send_task.rb, line 3
def type
  'task'
end