Ejemplo n.º 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
Ejemplo n.º 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()
Ejemplo n.º 3
0
def main():
    participants = get_participants()
    waiter = gevent.event.AsyncResult()
    engine = msgflo.run(participants, done_cb=waiter.set)
    waiter.wait()
Ejemplo n.º 4
0
def run(done_cb=None):
    participants = get_participants()
    engine = msgflo.run(participants, done_cb=done_cb)
    return participants, engine