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

Method ProcessJobs

context.go:115–129  ·  view source on GitHub ↗

ProcessJobs drains all pending scheduled jobs. Call this regularly (e.g., inside Loop or Await) to allow resolve/reject handlers to run.

()

Source from the content-addressed store, hash-verified

113// ProcessJobs drains all pending scheduled jobs.
114// Call this regularly (e.g., inside Loop or Await) to allow resolve/reject handlers to run.
115func (ctx *Context) ProcessJobs() {
116 if ctx == nil || ctx.jobQueue == nil {
117 return
118 }
119 for {
120 select {
121 case job := <-ctx.jobQueue:
122 if job != nil {
123 job(ctx)
124 }
125 default:
126 return
127 }
128 }
129}
130
131func (ctx *Context) drainJobs() {
132 if ctx == nil || ctx.jobQueue == nil {

Callers 7

TestContextPromiseFunction · 0.95
LoopMethod · 0.95
LoopOnceMethod · 0.95
PollIOMethod · 0.95
AwaitMethod · 0.95
NewPromiseMethod · 0.95

Calls

no outgoing calls

Tested by 2

TestContextPromiseFunction · 0.76