rodario¶
A simple, redis-backed Python actor framework
The Registry¶
-
class
rodario.registry.
Registry
[source]¶ Actor registry class (singleton wrapper)
-
static
__new__
()[source]¶ Retrieve the singleton instance for Registry.
Return type: rodario.registry._Singleton
-
static
-
class
rodario.registry.
_Singleton
[source]¶ Singleton for actor registry
-
exists
(uuid)[source]¶ Test whether an actor exists in the registry.
Parameters: uuid (str) – UUID of the actor to check for Return type: bool
-
get_proxy
(uuid)[source]¶ Return an ActorProxy for the given UUID.
Parameters: uuid (str) – The UUID to return a proxy object for Return type: rodario.actors.ActorProxy
-
Actors and Proxies¶
-
class
rodario.actors.
Actor
(uuid=None)[source]¶ Base Actor class
-
__init__
(uuid=None)[source]¶ Initialize the Actor object.
Parameters: uuid (str) – Optionally-provided UUID
-
proxy
()[source]¶ Wrap this Actor in an ActorProxy object.
Return type: rodario.actors.ActorProxy
-
-
class
rodario.actors.
ActorProxy
(actor=None, uuid=None)[source]¶ Proxy object that fires calls to an actor over redis pubsub
-
__init__
(actor=None, uuid=None)[source]¶ Initialize instance of ActorProxy.
Accepts either an Actor object to clone or a UUID, but not both.
Parameters: - actor (rodario.actors.Actor) – Actor to clone
- uuid (str) – UUID of Actor to clone
-
_proxy
(method_name, *args, **kwargs)[source]¶ Proxy a method call to redis pubsub.
This method is not meant to be called directly. Instead, it is used by the proxy’s self-generated methods to provide the proxy with the same public API as the actor it represents.
Parameters: Return type:
-
proxyid
= None¶ This proxy object’s UUID for creating unique channels
-
Decorators¶
Exceptions¶
-
class
rodario.exceptions.
InvalidActorException
[source]¶ Raised when a referenced actor does not exist
-
class
rodario.exceptions.
InvalidProxyException
[source]¶ Raised when a proxy is not given a valid object to wrap