Skip to main content

JS_EnqueueJob

Function JS_EnqueueJob 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn JS_EnqueueJob( ctx: *mut JsContext, job_func: JobFunc, argc: c_int, argv: *const JsValue, ) -> c_int
Expand description

JS_EnqueueJob: run job_func at the next job checkpoint.

The engine drains its queue at the end of each evaluation, so a job enqueued here runs before the next API call returns — which satisfies the ordering a caller depends on (Promise callbacks before the next turn) without needing a host-visible queue.

§Safety

job_func must be a JSJobFunc; argv must point at argc live values.