Ejemplo n.º 1
0
def run():
    with Manager() as m:
        uid = m.generate_uid()
        m.spawn(produce, uid=uid)
        m.spawn(consume, uid=uid)
Ejemplo n.º 2
0
def consume(m: Manager, uid: str) -> None:
    with m.open_reader_queue(uid) as q:
        for x in q:
            logger.info("<- %d", x)
            time.sleep(0.1)