Class: Concurrent::Actor::Root
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
AbstractContext
|
|
Instance Chain:
|
|
Inherits: |
Concurrent::Actor::AbstractContext
|
Defined in: | lib/concurrent-ruby-edge/concurrent/actor/root.rb |
Overview
implements the root actor
Constant Summary
Concern::Logging
- Included
Class Method Summary
- .new ⇒ Root constructor
AbstractContext
- Inherited
.spawn | Behaves as spawn but |
.spawn! | behaves as spawn! but |
.to_spawn_options |
Instance Attribute Summary
Instance Method Summary
- #behaviour_definition
- #dead_letter_routing
-
#on_message(message)
to allow spawning of new actors, spawn needs to be called inside the parent
Actor
.
AbstractContext
- Inherited
#<< | Alias for AbstractContext#tell. |
#ask, | |
#ask! | Alias for AbstractContext#ask. |
#behaviour_definition, | |
#dead_letter_routing | Defines an actor responsible for dead letters. |
#default_executor | override to se different default executor, e.g. |
#default_reference_class | override if different class for reference is needed. |
#envelope, | |
#on_event | override to add custom code invocation on internal events like |
#on_message, | |
#pass | if you want to pass the message to next behaviour, usually |
#tell | tell self a message. |
#initialize_core, #on_envelope |
InternalDelegations
- Included
#behaviour | see Core#behaviour |
#behaviour! | see Core#behaviour! |
#children, #context, #dead_letter_routing, | |
#log | delegates to core.log. |
#redirect, #terminate! |
Concern::Logging
- Included
#log | Logs through Concurrent.global_logger, it can be overridden by setting @logger. |
PublicDelegations
- Included
#actor_class | Alias for PublicDelegations#context_class. |
#context_class, #executor, #name, #parent, #path, | |
#ref | Alias for PublicDelegations#reference. |
#reference |
TypeCheck
- Included
Constructor Details
.new ⇒ Root
# File 'lib/concurrent-ruby-edge/concurrent/actor/root.rb', line 9
def initialize # noinspection RubyArgCount @dead_letter_router = Core.new(parent: reference, class: DefaultDeadLetterHandler, supervise: true, name: :default_dead_letter_handler).reference end
Instance Method Details
#behaviour_definition
[ GitHub ]# File 'lib/concurrent-ruby-edge/concurrent/actor/root.rb', line 33
def behaviour_definition [*Behaviour.base(:just_log), *Behaviour.supervising, *Behaviour. ] end
#dead_letter_routing
[ GitHub ]# File 'lib/concurrent-ruby-edge/concurrent/actor/root.rb', line 29
def dead_letter_routing @dead_letter_router end
#on_message(message)
to allow spawning of new actors, spawn needs to be called inside the parent Actor
# File 'lib/concurrent-ruby-edge/concurrent/actor/root.rb', line 18
def ( ) case when .is_a?(::Array) && .first == :spawn Actor.spawn [1], & [2] when == :dead_letter_routing @dead_letter_router else # ignore end end