Esempio n. 1
0
def start_connector(config):
    loop = asyncio.get_event_loop()

    for worker in INCOMING_WORKERS.values():
        loop.create_task(worker(config))

    for worker in OUTGOING_WORKERS.values():
        loop.create_task(worker(config))
Esempio n. 2
0
def connector_tasks(config, outgoing=True) -> List[Coroutine]:
    tasks: List[Coroutine] = []
    for worker in INCOMING_WORKERS.values():
        tasks.append(worker(config))

    if outgoing:
        for worker in OUTGOING_WORKERS.values():
            tasks.append(worker(config))
    return tasks