class Movie::ActorContext(T)

Defined in:

movie/context.cr

Constructors

Instance Method Summary

Instance methods inherited from class Movie::AbstractActorContext

accepts_user_messages? : Bool accepts_user_messages?, deliver_serializable(message : Object, sender : ActorRefBase | Nil) : Nil deliver_serializable, discard_user_messages? : Bool discard_user_messages?, path : ActorPath | Nil path, rebind_path(path : ActorPath | Nil) : Nil rebind_path, ref : ActorRefBase ref, register_watcher(actor : ActorRefBase) : Bool register_watcher

Constructor Detail

def self.new(behavior : AbstractBehavior(T), ref : ActorRef(T), system : AbstractActorSystem, restart_strategy : RestartStrategy, supervision_config : SupervisionConfig = SupervisionConfig.default, path : ActorPath | Nil = nil) #

[View source]

Instance Method Detail

def <<(message : T) #

[View source]
def accepts_user_messages? : Bool #

[View source]
def ask(target : ActorRef(M), message : M, response_type : T.class = Nil, timeout : Time::Span | Nil = nil) : Future(T) forall M, T #

[View source]
def attach_child(child : ActorRef(U), *, notify_child : Bool = true) forall U #

[View source]
def deliver(message : T, sender : ActorRefBase | Nil) #

[View source]
def deliver_serializable(message : Object, sender : ActorRefBase | Nil) : Nil #

Delivers a deserialized wire value without requiring the wire wrapper to know the actor's full generic message type (which may be a union).


[View source]
def discard_user_messages? : Bool #

[View source]
def extension(id : ExtensionId(U)) : U forall U #

Retrieve a system extension via its ExtensionId (Akka-style). Example: ctx.extension(Movie::Remote::Remoting)


[View source]
def log : Log #

[View source]
def mailbox=(mailbox : Mailbox(T)) #

[View source]
def on_message(message : Envelope(T)) #

[View source]
def on_message(message : MailboxEnvelope(T)) #

[View source]
def on_system_message(message : Envelope(SystemMessage)) #

[View source]
def on_system_message(message : MailboxEnvelope(SystemMessage)) #

[View source]
def path : ActorPath | Nil #

[View source]
def pipe(future : Future(U), reply_to : ActorRef(V), success : U -> V, failure : Exception -> V) : Nil forall U, V #

Pipe a future result to a target actor using custom success/failure mappers.


[View source]
def pipe(future : Future(U), reply_to : ActorRef(Pipe::Message(U))) : Nil forall U #

Pipe a future result to a target actor as Pipe::Success or Pipe::Failure.


[View source]
def rebind_path(path : ActorPath | Nil) : Nil #

[View source]
def ref : ActorRef(T) #

[View source]
def register_watcher(actor : ActorRefBase) : Bool #

[View source]
def send_system_message(message : SystemMessage) #

[View source]
def sender : ActorRefBase | Nil #

[View source]
def spawn(behavior : AbstractBehavior(U), restart_strategy : RestartStrategy = @restart_strategy, supervision_config : SupervisionConfig = @supervision_config, name : String | Nil = nil) : ActorRef(U) forall U #

Spawns a child actor under this actor's supervision. If name is provided, the child gets a hierarchical path: {parent_path}/{name} If name is nil, generates a unique name based on actor ID.


[View source]
def start(internal = false) #

[View source]
def state #

[View source]
def stop #

[View source]
def supervision_config : SupervisionConfig #

[View source]
def system : AbstractActorSystem #

[View source]
def tell(message : T) #

[View source]
def watch(actor : ActorRef(U)) forall U #

[View source]
def watcher_count : Int32 #

[View source]