Пример #1
0
def participant():
    role = 'testdisplay/0'
    participant = display.Participant(role)
    engine = msgflo.run([participant], broker=BROKER)
    gevent.sleep(0.2)
    assert participant._engine.connected
    yield participant
    engine._client = None  # disconnect
Пример #2
0
def main():
    waiter = gevent.event.AsyncResult()
    role = sys.argv[1] if len(sys.argv) > 1 else 'repeat'
    repeater = NetworkBars(role)
    engine = msgflo.run(repeater, done_cb=waiter.set)

    print("Repeat running on %s" % (engine.broker_url))
    sys.stdout.flush()
    waiter.wait()
    print("Shutdown")
    sys.stdout.flush()
Пример #3
0
def main():
    participants = get_participants()
    waiter = gevent.event.AsyncResult()
    engine = msgflo.run(participants, done_cb=waiter.set)
    waiter.wait()
Пример #4
0
def run(done_cb=None):
    participants = get_participants()
    engine = msgflo.run(participants, done_cb=done_cb)
    return participants, engine