Registry which provides easy access to all running actors.
Contains global state, but should be thread-safe.
messageto all actors of the specified
target_classis specified, the message is broadcasted to all actors.
- message (picklable dict) – the message to send
- target_class (class or class name) – optional actor class to broadcast the message to
ActorReffor all running actors of the given class, or of any subclass of the given class.
Parameters: actor_class (class) – actor class, or any superclass of the actor Returns: list of
ActorReffor all running actors of the given class name.
Parameters: actor_class_name (string) – actor class name Returns: list of
Get an actor by its universally unique URN.
Parameters: actor_urn (string) – actor URN Returns:
Noneif not found
ActorRefin the registry.
This is done automatically when an actor is started, e.g. by calling
Parameters: actor_ref (
pykka.ActorRef) – reference to the actor to register
Stop all running actors.
timeoutworks as for
True, the actors are guaranteed to be stopped in the reverse of the order they were started in. This is helpful if you have simple dependencies in between your actors, where it is sufficient to shut down actors in a LIFO manner: last started, first stopped.
If you have more complex dependencies in between your actors, you should take care to shut them down in the required order yourself, e.g. by stopping dependees from a dependency’s
Returns: If not blocking, a list with a future for each stop action. If blocking, a list of return values from