示例#1
0
文件: run.py 项目: smurfix/MoaT
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
示例#2
0
文件: run.py 项目: ZigmundRat/moat
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
示例#3
0
文件: run.py 项目: smurfix/MoaT
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
示例#4
0
文件: run.py 项目: ZigmundRat/moat
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