Module parley.controllers.thread

Classes

class ThreadActor(parley.actor.AbstractActor):

QueueClass = <class parley.controllers.thread.ThreadQueue>

name = <property object>

def _get_name(self):
def _handle_signal(self, signal):
If this function is called, we know that a signal is waiting.
Depending on the value of self.trap_exceptions, we either
raise the signal as an exception or return it as a message.

Overrides: parley.actor.AbstractActor

def _next_message(self, msg_filter, wait):

Overrides: parley.actor.AbstractActor

def _set_name(self, name):
def go(self):

Overrides: parley.actor.AbstractActor

def recv(self, msg_filter=None, wait=True):

Overrides: parley.actor.AbstractActor

def register_id(self):

Overrides: parley.actor.AbstractActor

def run(self):
Hand off control to self.target.

This function will be spawned in a new frame of execution.

Overrides: parley.actor.AbstractActor

class ThreadController(parley.controller.AbstractController):

ActorClass = <class 'parley.controllers.thread.ThreadActor'>

def _create_link(self, a, b):

Overrides: parley.controller.AbstractController

def _current_actor(self):

Overrides: parley.controller.AbstractController

def _current_actor_id(self):

Overrides: parley.controller.AbstractController

def _current_actor_proxy(self):

Overrides: parley.controller.AbstractController

def _quit(self, actor_id):

Overrides: parley.controller.AbstractController

def _remove_link(self, a, b):

Overrides: parley.controller.AbstractController

def _spawn(self, target, args, kwargs, link=False):

Overrides: parley.controller.AbstractController

def alert_exception(self, origin_id, e):

Overrides: parley.controller.AbstractController

def alert_quit(self, origin_id):

Overrides: parley.controller.AbstractController

def link(self, target):

Overrides: parley.controller.AbstractController

def lookup(self, name):

Overrides: parley.controller.AbstractController

def register(self, actor_proxy, name):

Overrides: parley.controller.AbstractController

def send(self, target_id, msg):

Overrides: parley.controller.AbstractController

def send_signal(self, target_id, msg):

Overrides: parley.controller.AbstractController

def spawn(self, target, *args, **kwargs):

Overrides: parley.controller.AbstractController

def spawn_link(self, target, *args, **kwargs):

Overrides: parley.controller.AbstractController

def unlink(self, target):

Overrides: parley.controller.AbstractController

def unregister(self, name):

Overrides: parley.controller.AbstractController

class ThreadQueue(Queue.Queue):
def _empty(self):

Overrides: Queue.Queue

def _full(self):

Overrides: Queue.Queue

def _get(self):

Overrides: Queue.Queue

def _init(self, maxsize):

Overrides: Queue.Queue

def _put(self, item):

Overrides: Queue.Queue

def _qsize(self):

Overrides: Queue.Queue

def empty(self):
Return True if the queue is empty, False otherwise (not reliable!).

Overrides: Queue.Queue

def full(self):
Return True if the queue is full, False otherwise (not reliable!).

Overrides: Queue.Queue

def get(self, block=True, timeout=None):
Remove and return an item from the queue.

If optional args 'block' is true and 'timeout' is None (the default),
block if necessary until an item is available. If 'timeout' is
a positive number, it blocks at most 'timeout' seconds and raises
the Empty exception if no item was available within that time.
Otherwise ('block' is false), return an item if one is immediately
available, else raise the Empty exception ('timeout' is ignored
in that case).

Overrides: Queue.Queue

def get_nowait(self):

Overrides: Queue.Queue

def put(self, item, block=True, timeout=None):
Put an item into the queue.

If optional args 'block' is true and 'timeout' is None (the default),
block if necessary until a free slot is available. If 'timeout' is
a positive number, it blocks at most 'timeout' seconds and raises
the Full exception if no free slot was available within that time.
Otherwise ('block' is false), put an item on the queue if a free slot
is immediately available, else raise the Full exception ('timeout'
is ignored in that case).

Overrides: Queue.Queue

def put_nowait(self, item):
Put an item into the queue without blocking.

Only enqueue the item if a free slot is immediately available.
Otherwise raise the Full exception.

Overrides: Queue.Queue

def qsize(self):
Return the approximate size of the queue (not reliable!).

Overrides: Queue.Queue