Package Products :: Package ZenHub :: Module notify :: Class BatchNotifier |
[hide private]
[frames] | no frames]

# Class BatchNotifier

source code

    object --+
             |
            BatchNotifier

Processes the expensive getSubDevices call in batches. A singleton instance is registered as a utility in zcml. The queue contains NotifyItem instances. If notify_subdevices is called and an item exists in the queue for the same device class, then the new service UID and notify function are appended to the existing item. Once an item is moved from the queue to _current_item member, it is being processed and further notify_subdevices calls for the same device class will append a new item to the queue.

Instance Methods | [hide private]
__init__(self) | source code
notify_subdevices(self, device_class, service_uid, notify_function) | source code
_find_or_create_item(self, device_class) | source code
_create_deferred(self) | source code
_call_later(self, d) | source code
_switch_to_next_item(self) | source code
_call_notify_functions(self, device) | source code
_callback(self, result) | source code
_errback(self, failure) | source code

Class Variables | [hide private]
| _BATCH_SIZE = `10`
| _DELAY = `0.05`

Method Details | [hide private]

### __init__(self) (Constructor) | source code
Overrides: object.__init__ (inherited documentation)