Class: Ruote::DispatchPool

Inherits:
Object
  • Object
show all
Defined in:
lib/ruote/svc/dispatch_pool.rb

Overview

The class where despatchement of workitems towards [real] participant is done.

Can be extended/replaced for better handling of Thread (why not something like a thread pool or no threads at all).

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ DispatchPool

Returns a new instance of DispatchPool


37
38
39
40
# File 'lib/ruote/svc/dispatch_pool.rb', line 37

def initialize(context)

  @context = context
end

Instance Method Details

#handle(msg) ⇒ Object


42
43
44
45
46
47
# File 'lib/ruote/svc/dispatch_pool.rb', line 42

def handle(msg)

  return unless msg['action'].match(/^dispatch/)

  send(msg['action'], msg)
end