views:

111

answers:

1

its a server side Javascript (rhino engine), so setTimeout is not available. how to run a function asynchronously?

+3  A: 

Have a look at the Multithreaded Script Execution example on the Rhino Examples page. Basically, JavaScript does not support threading directly, but you may be able to use a Java thread to achieve what you are looking for.

Justin Ethier