| pool = concurrent.futures.ProcessPoolExecutor()
|
|
|
| background_tasks = set()
|
|
|
| def cpu_bound():
|
| pass
|
|
|
| async def task_thing():
|
|
|
| task = await loop.run_in_executor(pool, cpu_bound)
|
|
|
| async def queue_thing():
|
|
|
| while True:
|
|
|
| job_def = await fifo_queue.get()
|
| task = asyncio.create_task(task_thing(job_def))
|
| background_tasks.add(task)
|