Let’s say I have functions long_taking_function
and long_taking_function2
. Both take a long time. Is it considered bad practice to have ‘nested’ invokeAsynchronous
and invokeLater
? If so, how can I improve this?
def long_process():
bla = long_taking_function()
if bla:
def send_back():
if bla:
def long_process2():
bla2 = long_taking_function2()
def send_back2():
if bla2:
...
else:
...
system.util.invokeLater(send_back2)
system.util.invokeAsynchronous(long_process2)
else:
...
system.util.invokeLater(send_back)
else:
...
system.util.invokeAsynchronous(long_process)