def collect_event(e): """\ Run an event through the system. Create a list of things to be done for this event. """ work = ConcurrentWorkSequence(e, None) for w in workers.values(): if w.does_event(e): w.match_count += 1 work.append(w) return work
def collect_failure(e): """\ Run a failure through the system. Create a list of things to be done for it. """ from moat.event import Event assert isinstance(e, (Event, BaseException)), "Cannot be used as an event: " + repr(e) work = ConcurrentWorkSequence(e, None) for w in workers.values(): if isinstance(w, ExcWorker) and w.does_failure(e): work.append(w) return work
def collect_failure(e): """\ Run a failure through the system. Create a list of things to be done for it. """ from moat.event import Event assert isinstance( e, (Event, BaseException)), "Cannot be used as an event: " + repr(e) work = ConcurrentWorkSequence(e, None) for w in workers.values(): if isinstance(w, ExcWorker) and w.does_failure(e): work.append(w) return work