Class: Concurrent::Actor::Behaviour::Abstract
- Inherits:
-
Object
- Object
- Concurrent::Actor::Behaviour::Abstract
- Includes:
- InternalDelegations, TypeCheck
- Defined in:
- lib/concurrent-ruby-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)
12 13 14 |
# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb', line 12 def core @core end |
#subsequent ⇒ undocumented (readonly)
12 13 14 |
# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb', line 12 def subsequent @subsequent end |
Instance Method Details
#broadcast(public, event) ⇒ undocumented
broadcasts event to all behaviours and context
39 40 41 |
# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb', line 39 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
21 22 23 |
# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb', line 21 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
32 33 34 |
# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb', line 32 def on_event(public, event) subsequent.on_event public, event if subsequent end |
#pass(envelope) ⇒ undocumented
26 27 28 |
# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb', line 26 def pass(envelope) subsequent.on_envelope envelope end |
#reject_envelope(envelope) ⇒ undocumented
43 44 45 46 47 |
# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb', line 43 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