Sha256: bc60bbdc84ee2f762658728bf1c9b97343219b98f29a5111e4cbdfeba75f6fac

Contents?: true

Size: 822 Bytes

Versions: 1

Compression:

Stored size: 822 Bytes

Contents

require 'legion/transport/exchanges/task'

module Legion
  module Exception
    class InvalidTaskStatus; end
    class InvalidTaskId; end
  end
end

module Legion
  module Transport
    module Messages
      class TaskUpdate < Legion::Transport::Message
        def routing_key
          'task.update'
        end

        def exchange
          Legion::Transport::Exchanges::Task
        end

        def valid_status
          conditioner = ['conditioner.queued', 'conditioner.failed', 'conditioner.exception']
          transformer = ['transformer.queued', 'transformer.succeeded', 'transformer.exception']
          task = ['task.scheduled', 'task.queued', 'task.completed', 'task.exception', 'task.delayed']
          status = conditioner + transformer + task
          status
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
legion-transport-1.0.0 lib/legion/transport/messages/task_update.rb