This project is read-only.

Execution Timeout for Scripts

May 6, 2014 at 3:32 PM

is it possible to set a timeout for an execution of a script function?
For example when i call a function with engine.Execute(...) and this function ends up in an infinite loop. Here i want something like a timeout, which terminates the execution at some point. Is there a way to do that?
May 6, 2014 at 7:13 PM
There is no support for that as of yet. There is some talk on this here:!topic/v8-users/VjQhdE1qK4s

Some ideas for now:
  1. If you have full control over the code, call a manage side method to check if the script should stop and return.
  2. Launch the script via a thread, then terminate it if it takes too long.
Going forward, if this is really needed, I can look into implementing something more official. If so, feel free to make a feature request under the "Issues" tab.
May 7, 2014 at 3:44 PM
Thanks for your response.
I think something like your second point can solve that for me for now, but i think it could be useful to have something like that out of the box, so i created a feature request.