actor_system library

Classes

ActorContext
A context for an actor. The context is provided to the actor for
ActorRef
A reference to an actor. The only way to communicate with an actor is to send messages to it using the API of the ActorRef.
ActorSystem
An ActorSystem is a collection of actors, the can communicate with each other. An actor can only create or lookup actors in the same ActorSystem.
ActorSystemMetrics
Provides metrics for an actor system.
BaseContext

Enums

MissingHostHandling
Defines the handling of an actor path if the host part is missing.

Extensions

UriExtension on Uri

Constants

actorScheme → const String
Scheme for an actor path.
initMsg → const InitMessage
A constant to be used to initialize an actor after it is created.
localSystem → const String
Placeholder for the local actor system.
shutdownMsg → const ShutdownMessage
A constant to be used to shutdown an actor.
zoneCorrelationIdKey → const String
Use this constant as a key for a Zone value to set a correlation id.
zoneSenderKey → const String
Use this constant as a key for a Zone value to set an actor as a sender.

Functions

actorPath(String path, {String? system, String? tag}) Uri
Creates an Uri valid for an actor path.
localActorPath(String path) Uri
Creates an Uri for an actor path in the local actor system.
patternMatcher(Pattern pattern) PathMatcher
Return a PathMatcher that uses the given pattern on the path of the actor.

Typedefs

Actor = FutureOr<void> Function(ActorContext context, Object? message)
An actor is a function that processes messages. This function should never be called directly. It should only be used as a parameter to ActorContext.createActor.
ActorFactory = FutureOr<Actor> Function(Uri path)
A factory to create an actor. The given path can be used to determine the type of the actor to create.
CreateActor = FutureOr<ActorRef> Function(Uri path, int mailboxSize)
Creates an actor for the given Uri.
LookupActor = FutureOr<ActorRef?> Function(Uri path)
Looks up an actor by the given Uri.
PathMatcher = bool Function(Uri path)
Returns true, if the given path matches.

Exceptions / Errors

ActorStopped
Thrown by ActorRef.send if the message can't be added to actors mailbox because the actor is stopped.
MailboxFull
Thrown by ActorRef.send if the message can't be added to actors mailbox because it is full.
MessageNotDelivered
Thrown by ActorRef.send if the message can't be added to actors mailbox.
NoFactoryFound
Thrown by BaseContext.createActor if no factory was found to create the actor.
SkipMessage
If an actor throws an instance of this type while processing an message, the actor will not be restarted.