Adds a new event to the processing queue.
(self, receivers, *args)
| 32 | self._events = [] |
| 33 | |
| 34 | def add_event(self, receivers, *args): |
| 35 | """Adds a new event to the processing queue.""" |
| 36 | if not all(callable(receiver) for receiver in receivers): |
| 37 | raise TypeError('Receivers are expected to be callables.') |
| 38 | def event(): |
| 39 | for receiver in list(receivers): |
| 40 | receiver(*args) |
| 41 | with self._lock: |
| 42 | self._events.append(event) |
| 43 | |
| 44 | def process_events(self): |
| 45 | """Invokes each of the events in the queue. |
no outgoing calls
no test coverage detected