MCPcopy Create free account
hub / github.com/buke/quickjs-go / LoopOnce

Method LoopOnce

context.go:1279–1287  ·  view source on GitHub ↗

LoopOnce runs one event-loop iteration and returns QuickJS libc status.

()

Source from the content-addressed store, hash-verified

1277
1278// LoopOnce runs one event-loop iteration and returns QuickJS libc status.
1279func (ctx *Context) LoopOnce() int {
1280 if !ctx.hasValidRef() {
1281 return -1
1282 }
1283 ctx.ProcessJobs()
1284 ret := int(C.js_std_loop_once(ctx.ref))
1285 ctx.ProcessJobs()
1286 return ret
1287}
1288
1289// PollIO polls host I/O and returns QuickJS libc status.
1290func (ctx *Context) PollIO(timeoutMS int) int {

Calls 2

hasValidRefMethod · 0.95
ProcessJobsMethod · 0.95