Module v.c.l.dispatcher

Part of vmc.contrib.louie

Multiple-producer-multiple-consumer signal-dispatching.

``dispatcher`` is the core of Louie, providing the primary API and the
core logic for the system.

Internal attributes:

- ``WEAKREF_TYPES``: Tuple of types/classes which represent weak
  references to receivers, and thus must be dereferenced on retrieval
  to retrieve the callable object
        
- ``connections``::

    { senderkey (id) : { signal : [receivers...] } }
    
- ``senders``: Used for cleaning up sender references on sender
  deletion::

    { senderkey (id) : weakref(sender) }
    
- ``senders_back``: Used for cleaning up receiver references on receiver
  deletion::

    { receiverkey (id) : [senderkey (id)...] }
Function print_stats Undocumented
Function get_receivers Get list of receivers from global tables.
Function live_receivers Filter sequence of receivers to get resolved, live receivers.
def print_stats():
Undocumented
def get_receivers(sender=Any, signal=All):

Get list of receivers from global tables.

This function allows you to retrieve the raw list of receivers from the connections table for the given sender and signal pair.

Note: There is no guarantee that this is the actual list stored in the connections table, so the value should be treated as a simple iterable/truth value rather than, for instance a list to which you might append new records.

Normally you would use ``live_receivers(get_receivers(...))`` to retrieve the actual receiver objects as an iterable object.
def live_receivers(receivers):

Filter sequence of receivers to get resolved, live receivers.

This is a generator which will iterate over the passed sequence, checking for weak references and resolving them, then returning all live receivers.
def _remove_receiver(receiver):
Remove ``receiver`` from connections.
def _cleanup_connections(senderkey, signal):
Delete empty signals for ``senderkey``. Delete ``senderkey`` if empty.
def _remove_sender(senderkey):
Remove ``senderkey`` from connections.
def _remove_back_refs(senderkey):
Remove all back-references to this ``senderkey``.
def _remove_old_back_refs(senderkey, signal, receiver, receivers):

Kill old ``senders_back`` references from ``receiver``.

This guards against multiple registration of the same receiver for a given signal and sender leaking memory as old back reference records build up.

Also removes old receiver instance from receivers.
def _kill_back_ref(receiver, senderkey):
Do actual removal of back reference from ``receiver`` to ``senderkey``.
API Documentation for vodafone-mobile-connect-card-driver-for-linux, generated by pydoctor at 2008-01-10 13:06:31.