You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtimefrombilliardimportPooldeflong_running_task(x):
time.sleep(10) # Simulate a long taskreturnx*xif__name__=='__main__':
withPool(processes=2, timeout=[5]) aspool:
try:
result=pool.map(long_running_task, (2,))
print(result)
exceptExceptionase:
print(f"An error occurred: `{e}")
An Error occurs:
At the top i added an print statement within the billiard code to show the value of start and timeout.
As you can see in the case of map start is not a single value instead it is a list of all starttimes for the processes.