- class pykka.ActorRegistry
Registry which provides easy access to all running actors.
Contains global state, but should be thread-safe.
- classmethod broadcast(message, target_class=None)
messageto all actors of the specified
target_classis specified, the message is broadcasted to all actors.
message (any) – the message to send
target_class (class or class name) – optional actor class to broadcast the message to
- classmethod get_by_class(actor_class)
ActorReffor all running actors of the given class, or of any subclass of the given class.
actor_class (class) – actor class, or any superclass of the actor
- classmethod get_by_class_name(actor_class_name)
ActorReffor all running actors of the given class name.
actor_class_name (string) – actor class name
- classmethod get_by_urn(actor_urn)
Get an actor by its universally unique URN.
actor_urn (string) – actor URN
Noneif not found
- classmethod register(actor_ref)
ActorRefin the registry.
This is done automatically when an actor is started, e.g. by calling
pykka.ActorRef) – reference to the actor to register
- classmethod stop_all(block=True, timeout=None)
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
If not blocking, a list with a future for each stop action. If blocking, a list of return values from