import asyncio

NUM_WORKERS = 3


async def ask(q):
    while True:
        res = input('Enter data: ')
        await q.put(res)
        await asyncio.sleep(0.1)


async def produce(q):
    while True:
        elem = await q.get()  # ждем элемент
        print(f'Processing {elem} ...')
        await asyncio.sleep(3)  # симуляция асинхронной обработки
        print(f'{elem} done')


async def main():
    queue = asyncio.Queue()
    print('Main started')
    for _ in range(NUM_WORKERS):  # запускаем сразу несколько асинхронных воркеров
        asyncio.create_task(produce(queue))    
    await ask(queue)


if __name__ == '__main__':
    asyncio.run(main())
