quickjs_es_runtime icon indicating copy to clipboard operation
quickjs_es_runtime copied to clipboard

timeouts on invocations like call_function and eval

Open andrieshiemstra opened this issue 4 years ago • 2 comments

for https://github.com/theduke/quickjs-rs/issues/4

i think i want to impl this a bit broader (basicly in all public methods of JSRealmAdapter) so you can allways recover from endless loops and such...

Also i want to reimpl timeouts for get_promise_result (which was removed because it was difficult to impl with Futures)

andrieshiemstra avatar Dec 17 '21 08:12 andrieshiemstra

i'm guessing i should give all loop methods in JSRuntimeFacade a timeout: Option<Duration>

this should set a thread_local var which is used by the interupt handler

andrieshiemstra avatar Dec 17 '21 09:12 andrieshiemstra

moving this to next milestone

i need to figure out for myself if i want a global-ish timeout for all tasks added to the event loop or if i want fine-grained controll over setting a timeout per job...

API wise i also want to think about timeouts on promise (fail promises if not fullfilled after x secs and such)

i also want to do some research on whether or not other engines like spidermonkey have a interrupt handler mechanic (if not this will be a quickjs-only thing)

andrieshiemstra avatar Jan 02 '22 11:01 andrieshiemstra