Class: Concurrent::Actor::Utils::AbstractWorker
- Inherits:
-
RestartingContext
- Object
- AbstractContext
- RestartingContext
- Concurrent::Actor::Utils::AbstractWorker
- Defined in:
- lib/concurrent/actor/utils/pool.rb
Instance Attribute Summary
Attributes inherited from AbstractContext
Instance Method Summary collapse
-
#initialize(balancer) ⇒ AbstractWorker
constructor
A new instance of AbstractWorker.
- #on_message(message) ⇒ Object
- #work(message) ⇒ Object
Methods inherited from RestartingContext
Methods inherited from AbstractContext
#ask, #behaviour_definition, #dead_letter_routing, #default_reference_class, #envelope, #on_envelope, #on_event, #pass, #tell
Methods included from InternalDelegations
#behaviour, #behaviour!, #children, #context, #dead_letter_routing, #log, #redirect, #terminate!
Methods included from PublicDelegations
#context_class, #executor, #name, #parent, #path, #reference
Methods included from TypeCheck
#Child!, #Child?, #Match!, #Match?, #Type!, #Type?
Constructor Details
#initialize(balancer) ⇒ AbstractWorker
Returns a new instance of AbstractWorker.
42 43 44 45 |
# File 'lib/concurrent/actor/utils/pool.rb', line 42 def initialize(balancer) @balancer = balancer @balancer << :subscribe end |
Instance Method Details
#on_message(message) ⇒ Object
47 48 49 50 51 |
# File 'lib/concurrent/actor/utils/pool.rb', line 47 def () work ensure @balancer << :subscribe end |
#work(message) ⇒ Object
53 54 55 |
# File 'lib/concurrent/actor/utils/pool.rb', line 53 def work() raise NotImplementedError end |