I am new to Python and coroutines, I am trying to leverage Python’s asyncio library to parallel process a blocking function. I am using python 3.8.6. I have a blocking function that takes in a different input from an array inputs, I need the blocking functions for each input to run concurrently. I have tried this but they still seem to run sequentially:
async def main():
tasks = [asyncio.create_task(blocking_function(input)) for input in inputs]
result = await asyncio.gather(*tasks)
print(result)