system.util.invokeAsynchronous and page swap

Hi,
I start a long running task by calling an f1 function with one parameter from the actionPerformed event of a button, where the f1 function does the job in this way:

[code]def f1(oneParameter):
#some calculations on oneParameter
def f2():
#long running task using parameters coming from f1 calculations above

system.util.invokeAsynchronous(f2)[/code]

What happens is that if I leave the page that started the long running task swapping to another page, that long running task stops. In my opinion that should not happen, because the long running task is not running in the graphic interface thread. Does that means that some sort of link connects the asynchronous thread to the page object that originated it? I need that long running task to go further, even if the operator swap to another page: any suggestion?

Thanks in advance, regards

Hello,
Why do you think the long running task stops when you swap the window? What evidence do you have of this? Can you show the script that you are running where this problem is evident?

I ran a test and found this to not be the case. I wrote the following script on a button that starts a long running process and then closes the window. The long running process did not stop, it outputted the text “still working good” after the window was closed. This is the script I put in a button actionPerformed event:

[code]
def func():
from java.lang import Thread
print “working”
Thread.sleep(3000)
print “still working good”

system.util.invokeAsynchronous(func)
system.nav.closeParentWindow(event)[/code]Best,