Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
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
Beispiel #4
0
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