This paste expires on 2023-07-26 15:25:20.893146. Repaste, or download this paste. . Pasted through web.

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)
Filename: None. Size: 382b. View raw, , hex, or download this file.