Sha256: 4d958b081f435df1c0fbd6d0a3432c35f605c930d922005f5094f5025ed48f5f

Contents?: true

Size: 566 Bytes

Versions: 2

Compression:

Stored size: 566 Bytes

Contents

module Legion::Extensions::Transformer::Transport::Messages
  class Message < Legion::Transport::Message
    def type
      'task'
    end

    def message
      { args: @options[:args] || @options }
    end

    def routing_key
      "#{function.runner.extension.values[:name]}.#{function.runner.values[:name]}.#{function.values[:name]}"
    end

    def exchange
      Legion::Transport::Exchange.new(function.runner.extension.values[:exchange])
    end

    def function
      @function ||= Legion::Data::Model::Function[@options[:function_id]]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lex-transformer-0.1.2 lib/legion/extensions/transformer/transport/messages/message.rb
lex-transformer-0.1.1 lib/legion/extensions/transformer/transport/messages/message.rb