Class: Actor::Start
- Inherits:
-
Object
- Object
- Actor::Start
- Includes:
- Messaging::Send::Dependency
- Defined in:
- lib/actor/start.rb
Instance Attribute Summary collapse
-
#actor ⇒ Object
readonly
Returns the value of attribute actor.
-
#supervisor_address ⇒ Object
Returns the value of attribute supervisor_address.
Attributes included from Messaging::Send::Dependency
Class Method Summary collapse
Instance Method Summary collapse
- #actor_crashed(error) ⇒ Object
- #actor_started ⇒ Object
- #actor_stopped ⇒ Object
- #address ⇒ Object
- #call ⇒ Object
-
#initialize(actor) ⇒ Start
constructor
A new instance of Start.
Constructor Details
#initialize(actor) ⇒ Start
Returns a new instance of Start.
8 9 10 |
# File 'lib/actor/start.rb', line 8 def initialize(actor) @actor = actor end |
Instance Attribute Details
#actor ⇒ Object (readonly)
Returns the value of attribute actor.
5 6 7 |
# File 'lib/actor/start.rb', line 5 def actor @actor end |
#supervisor_address ⇒ Object
Returns the value of attribute supervisor_address.
6 7 8 |
# File 'lib/actor/start.rb', line 6 def supervisor_address @supervisor_address end |
Class Method Details
.call(actor_or_actor_class, *arguments, **keyword_arguments, &block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/actor/start.rb', line 12 def self.call(actor_or_actor_class, *arguments, **keyword_arguments, &block) if actor_or_actor_class.is_a?(Actor) and not actor_or_actor_class.is_a?(Class) actor = actor_or_actor_class else actor = Build.(actor_or_actor_class, *arguments, **keyword_arguments, &block) end instance = new(actor) instance.send = Messaging::Send.new instance.supervisor_address = Supervisor::Address::Get.() instance.() end |
Instance Method Details
#actor_crashed(error) ⇒ Object
42 43 44 45 |
# File 'lib/actor/start.rb', line 42 def actor_crashed(error) actor_crashed = Messages::ActorCrashed.new(error, actor) send.(actor_crashed, supervisor_address) end |
#actor_started ⇒ Object
47 48 49 50 |
# File 'lib/actor/start.rb', line 47 def actor_started actor_started = Messages::ActorStarted.new(address, actor) send.(actor_started, supervisor_address) end |
#actor_stopped ⇒ Object
52 53 54 55 |
# File 'lib/actor/start.rb', line 52 def actor_stopped actor_stopped = Messages::ActorStopped.new(address, actor) send.(actor_stopped, supervisor_address) end |
#address ⇒ Object
57 58 59 |
# File 'lib/actor/start.rb', line 57 def address actor.address end |