class AbnormalExit(exceptions.Exception):
An actor will raise this exception if it terminated by means of an uncaught exception.
class AbstractActor(__builtin__.object):
QueueClass = <class parley.actor.AbstractQueue>
def _check_for_signals(self):
Check if any signals are waiting in the signal queue.def _handle_signal(self, signal):
Handle a received signal. Depending on the value of self.trap_exceptions, we either raise the signal as an exception or place it in the message queue.def _next_message(self, msg_filter, wait):
def get_msg(self):
Remove one message from the queue, blocking if none are available.def get_msg_nowait(self):
Remove one message from the queue if one exists, otherwise return None.def go(self):
Spawn self.run in a new frame of execution. This function is called by the controller when the created actor is to be spawned.def put_msg(self, msg):
Deliver the given message to this actor.def put_signal(self, msg):
def recv(self, msg_filter=None, wait=True):
def register_id(self):
Register self.id such that it can be retrieved by controller._get_current_actor_id() (e.g. by storing it in threadlocals).def run(self):
Hand off control to self.target. This function will be spawned in a new frame of execution.def schedule(self):
Check for signals and ask the controller to yield control of execution.
class AbstractQueue:
Controllers should define a queue implementation having this interface.def get(self):
def get_nowait(self):
def put(self, o):
class Become(exceptions.Exception):
This exception is thrown by the become() function to transfer control to the new target.
class SimpleQueue(parley.actor.AbstractQueue):
A wrapper around a list objects to implement the AbstractQueue interface.def get(self):
Overrides: parley.actor.AbstractQueue
def get_nowait(self):
Overrides: parley.actor.AbstractQueue
def put(self, o):
Overrides: parley.actor.AbstractQueue