Class DaemonKit::RuoteWorkitem
In: lib/daemon_kit/ruote_workitem.rb
Parent: Object

Dual purpose class that is a) responsible for parsing incoming workitems and delegating to the correct RuotePseudoParticipant, and b) wrapping the workitem hash into something a bit more digestable.

Methods

Public Class methods

Extract the class and method name from the workitem, then pick the matching class from the registered list of participants

Process incoming commands via an AMQP queue

Expects a JSON workitem from ruote that has these fields set in attributes key:

  {
    'reply_queue'    => 'queue to send replies to',
    'params' => {
      'command'  => '/actor/method'
    }
  }

Notes on the command key:

It looks like a resource, and will be treated as such. Is should be in the format of +/class/method+, and it will be passed the complete workitem as a hash.

Notes on replies

Replies are sent back to the queue specified in the reply_queue key.

Notes on errors

Where daemon-kit detects errors in attempting to parse and delegate the workitems, it will reply to the engine and set the following field with the error information:

  daemon_kit.error

Public Instance methods

Look at the workitem payload and attempt to determine if this workitem has timed out or not. This method will only ever work if you used the +:timeout: parameter was set for the expression.

[Validate]