I am going to start looking at converting my code use asyncio. I cant find an example or explanation that I understand. I was wondering if someone could convert this simple code to use asyncio rather than concurrent futures? This was some old code that helped my understand how threading could help with speeding things up.
import time
from concurrent import futures
def run(data):
time.sleep(.5)
print("Hello World")
return
data = range(20)
max_workers = 10
concurrent = futures.ThreadPoolExecutor(max_workers)
with concurrent as ex:
ex.map(run, data)