I have a custom background decorator. When I run a function in the background, how can I then check if all functions, that I started in the background, are done until I return?
#background decorator
def background(fn):
def wrapped(*args, **kwargs):
return asyncio.get_event_loop().run_in_executor(None, fn, *args, **kwargs)
return wrapped
#myfunction that I run in the background
@background
def myfunction():
#run some tasks
#main here I call "myfunction"
def main():
for i in list:
myfunction()
#check if all myfunction's are done then return (MY PROBLEM)