API Reference¶
actors module¶
-
class
actors.Actor[source]¶ Bases:
objectThe base class implemented by all actors.
Variables: context ( ActorContext) – Provides contextual information about this actor and the current message. Only valid within this actor.-
context= None¶
-
receive(message)[source]¶ Override to provide the actor behaviour.
Parameters: message – The current message.
-
ref¶ Alias for
self.context.self_ref.
-
sender¶ Alias for
self.context.sender.
-
supervisor_strategy(exception)¶
-
-
class
actors.ActorContext(system, supervisor)[source]¶ Bases:
actors.internal.factory.ActorFactoryProvides contextual information to actors. Only valid within the
Actor.receive()method.Variables: -
parent= None¶
-
self_ref= None¶
-
sender= None¶
-
system= None¶
-
-
class
actors.ActorSystem(system_dispatcher=None)[source]¶ Bases:
actors.internal.factory.ActorFactory-
dead_letters¶
-
-
class
actors.ActorRef(_cell)[source]¶ Bases:
object-
tell(message, sender=None)[source]¶ Send a message to this actor. Asynchronous fire-and-forget.
Parameters: - message (Any) – The message to send.
- sender (
Actor) – The sender of the message. If provided it will be made available to the receiving actor via theActor.senderattribute.
-
actors.utils module¶
actors.utils.proxy module¶
-
class
actors.utils.proxy.Invoke(name, args, kwargs)¶ Bases:
tuple-
args¶ Alias for field number 1
-
kwargs¶ Alias for field number 2
-
name¶ Alias for field number 0
-
-
actors.utils.proxy.as_proxy(actor_ref)[source]¶ Create a proxy wrapper from an existing reference. The actor MUST implement the
ProxyActorinterface.Parameters: actor_ref ( ActorRef) – The actor reference.