Class: Concurrent::Actor::Behaviour::Abstract
- Inherits:
-
Object
- Object
- Concurrent::Actor::Behaviour::Abstract
- Includes:
- InternalDelegations, TypeCheck
- Defined in:
- lib-edge/concurrent/actor/behaviour/abstract.rb
Direct Known Subclasses
Awaits, Buffer, ErrorsOnUnknownMessage, ExecutesContext, Linking, Pausing, RemovesChild, SetResults, Supervising, Termination
Instance Attribute Summary collapse
- #core ⇒ undocumented readonly
- #subsequent ⇒ undocumented readonly
Instance Method Summary collapse
-
#broadcast(public, event) ⇒ undocumented
broadcasts event to all behaviours and context.
-
#initialize(core, subsequent, core_options) ⇒ Abstract
constructor
A new instance of Abstract.
-
#on_envelope(envelope) ⇒ undocumented
override to add extra behaviour.
-
#on_event(public, event) ⇒ undocumented
override to add extra behaviour.
- #pass(envelope) ⇒ undocumented
- #reject_envelope(envelope) ⇒ undocumented
-
#behaviour(behaviour_class) ⇒ undocumented
included
from InternalDelegations
see Core#behaviour.
-
#behaviour!(behaviour_class) ⇒ undocumented
included
from InternalDelegations
see Core#behaviour!.
- #Child!(value, *types) ⇒ undocumented included from TypeCheck
- #Child?(value, *types) ⇒ Boolean included from TypeCheck
- #children ⇒ undocumented included from InternalDelegations
- #context ⇒ AbstractContext included from InternalDelegations
- #context_class ⇒ undocumented (also: #actor_class) included from PublicDelegations
- #dead_letter_routing ⇒ undocumented included from InternalDelegations
- #executor ⇒ undocumented included from PublicDelegations
-
#log(level, message = nil, &block) ⇒ undocumented
included
from InternalDelegations
delegates to core.log.
- #Match!(value, *types) ⇒ undocumented included from TypeCheck
- #Match?(value, *types) ⇒ Boolean included from TypeCheck
- #name ⇒ undocumented included from PublicDelegations
- #parent ⇒ undocumented included from PublicDelegations
- #path ⇒ undocumented included from PublicDelegations
- #redirect(reference, envelope = self.envelope) ⇒ undocumented included from InternalDelegations
- #reference ⇒ undocumented (also: #ref) included from PublicDelegations
- #terminate!(reason = nil) ⇒ undocumented included from InternalDelegations
- #terminated? ⇒ Boolean included from InternalDelegations
- #Type!(value, *types) ⇒ undocumented included from TypeCheck
- #Type?(value, *types) ⇒ Boolean included from TypeCheck
Constructor Details
Instance Attribute Details
#core ⇒ undocumented (readonly)
10 11 12 |
# File 'lib-edge/concurrent/actor/behaviour/abstract.rb', line 10 def core @core end |
#subsequent ⇒ undocumented (readonly)
10 11 12 |
# File 'lib-edge/concurrent/actor/behaviour/abstract.rb', line 10 def subsequent @subsequent end |
Instance Method Details
#broadcast(public, event) ⇒ undocumented
broadcasts event to all behaviours and context
37 38 39 |
# File 'lib-edge/concurrent/actor/behaviour/abstract.rb', line 37 def broadcast(public, event) core.broadcast(public, event) end |
#on_envelope(envelope) ⇒ undocumented
Note:
super needs to be called not to break the chain
override to add extra behaviour
19 20 21 |
# File 'lib-edge/concurrent/actor/behaviour/abstract.rb', line 19 def on_envelope(envelope) pass envelope end |
#on_event(public, event) ⇒ undocumented
Note:
super needs to be called not to break the chain
override to add extra behaviour
30 31 32 |
# File 'lib-edge/concurrent/actor/behaviour/abstract.rb', line 30 def on_event(public, event) subsequent.on_event public, event if subsequent end |
#pass(envelope) ⇒ undocumented
24 25 26 |
# File 'lib-edge/concurrent/actor/behaviour/abstract.rb', line 24 def pass(envelope) subsequent.on_envelope envelope end |
#reject_envelope(envelope) ⇒ undocumented
41 42 43 44 45 |
# File 'lib-edge/concurrent/actor/behaviour/abstract.rb', line 41 def reject_envelope(envelope) envelope.reject! ActorTerminated.new(reference) dead_letter_routing << envelope unless envelope.future log(DEBUG) { "rejected #{envelope.} from #{envelope.sender_path}"} end |
#behaviour(behaviour_class) ⇒ undocumented Originally defined in module InternalDelegations
see Core#behaviour
#behaviour!(behaviour_class) ⇒ undocumented Originally defined in module InternalDelegations
see Core#behaviour!
#Child!(value, *types) ⇒ undocumented Originally defined in module TypeCheck
#Child?(value, *types) ⇒ Boolean Originally defined in module TypeCheck
#children ⇒ undocumented Originally defined in module InternalDelegations
#context ⇒ AbstractContext Originally defined in module InternalDelegations
#context_class ⇒ undocumented Also known as: actor_class Originally defined in module PublicDelegations
#dead_letter_routing ⇒ undocumented Originally defined in module InternalDelegations
#executor ⇒ undocumented Originally defined in module PublicDelegations
#log(level, message = nil, &block) ⇒ undocumented Originally defined in module InternalDelegations
delegates to core.log