import asyncio async def get_data_from_io(): ... async def process_data(data): ... async def main(): while true: data = await get_data_from_io() await process_data(data) asyncio.run(main())