Movie::ActorSystem(T)
Inherits Movie::AbstractActorSystem < Reference < Object
Constructors
new(main_behavior : AbstractBehavior(T), restart_strategy : RestartStrategy = RestartStrategy::RESTART, supervision_config : SupervisionConfig = SupervisionConfig.default, name : String = "actor-system-#{UUID.random.to_s[0..7]}") forall T
Creates an ActorSystem with explicit parameters.
new(main_behavior : AbstractBehavior(T), config : Config) forall T
Creates an ActorSystem from a Config. Config values override defaults. See ActorSystemConfig for available paths.
Example: config = Movie::Config.load("movie.yml", Movie::ActorSystemConfig.default) system = Movie::ActorSystem.new(main_behavior, config)
Instance methods
<<(message)
Sourceask(message : T, response_type : R.class = Nil, timeout : Time::Span | Nil = nil) : Future(R) forall R
Sourceask(target : ActorRef(M), message : M, response_type : R.class = Nil, timeout : Time::Span | Nil = nil) : Future(R) forall M, R
Ask a specific actor and receive a response, similar to ActorContext#ask.
spawn(behavior : AbstractBehavior(U), restart_strategy : RestartStrategy = RestartStrategy::RESTART, supervision_config : SupervisionConfig = @supervision_config, name : String | Nil = nil) : ActorRef(U) forall U
Spawns an actor under the user guardian. If name is provided, the actor gets path /user/{name}