the following code has 5 workers .... each opens its own worker_task()
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
future_to_url = {executor.submit(worker_task, command_, site_): site_ for site_ in URLS}
for future in concurrent.futures.as_completed(future_to_url):
url = future_to_url[future]
try: data = future.result()
BUT ..... inside each worker_task() ...... I cannot identify ... which of the 5 workers is currently being used (Worker_ID)
If I want to print('worker 3 has finished') inside worker_task() ..... I cannot do this because executor.submit does not allow
Any solutions?