how to run a javascript function asynchronously, without using setTimeout?

后端 未结 3 365
无人及你
无人及你 2021-02-01 07:03

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

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-01 07:19

    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.

提交回复
热议问题