Class: Concurrent::Actor::Root
- Inherits:
-
AbstractContext
- Object
- AbstractContext
- Concurrent::Actor::Root
- Defined in:
- lib/concurrent/actor/root.rb
Overview
implements the root actor
Instance Attribute Summary (collapse)
- - (undocumented) core inherited from AbstractContext readonly
Instance Method Summary (collapse)
- - (undocumented) behaviour_definition
- - (undocumented) dead_letter_routing
-
- (Root) initialize
constructor
A new instance of Root.
-
- (undocumented) on_message(message)
to allow spawning of new actors, spawn needs to be called inside the parent Actor.
Constructor Details
- (Root) initialize
Returns a new instance of Root
6 7 8 9 10 11 12 |
# File 'lib/concurrent/actor/root.rb', line 6 def initialize # noinspection RubyArgCount @dead_letter_router = Core.new(parent: reference, class: DefaultDeadLetterHandler, supervise: true, name: :default_dead_letter_handler).reference end |
Instance Attribute Details
- (undocumented) core (readonly) Originally defined in class AbstractContext
Instance Method Details
- (undocumented) behaviour_definition
30 31 32 33 34 |
# File 'lib/concurrent/actor/root.rb', line 30 def behaviour_definition [*Behaviour.base(:just_log), *Behaviour.supervising, *Behaviour.] end |
- (undocumented) dead_letter_routing
26 27 28 |
# File 'lib/concurrent/actor/root.rb', line 26 def dead_letter_routing @dead_letter_router end |
- (undocumented) on_message(message)
to allow spawning of new actors, spawn needs to be called inside the parent Actor
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/concurrent/actor/root.rb', line 15 def () case when .is_a?(::Array) && .first == :spawn Actor.spawn [1], &[2] when == :dead_letter_routing @dead_letter_router else # ignore end end |