MCPcopy Create free account
hub / github.com/cel-expr/cel-go / CheckInterrupt

Method CheckInterrupt

interpreter/frame.go:352–370  ·  view source on GitHub ↗

CheckInterrupt returns whether the evaluation has been interrupted.

()

Source from the content-addressed store, hash-verified

350
351// CheckInterrupt returns whether the evaluation has been interrupted.
352func (f *ExecutionFrame) CheckInterrupt() bool {
353 if f.ctx == nil {
354 return false
355 }
356 if f.ctx.interrupted.Load() {
357 return true
358 }
359 count := f.ctx.interruptCheckCount.Add(1)
360 if f.ctx.interruptCheckFrequency > 0 && count%uint64(f.ctx.interruptCheckFrequency) == 0 {
361 select {
362 case <-f.ctx.interrupt:
363 f.ctx.interrupted.Store(true)
364 return true
365 default:
366 return false
367 }
368 }
369 return false
370}
371
372// CostTracker returns the active CostTracker for this evaluation pass, or nil.
373func (f *ExecutionFrame) CostTracker() *CostTracker {

Callers 3

foldIterableMethod · 0.80
FoldEntryMethod · 0.80
TestFrameCheckInterruptFunction · 0.80

Calls 1

AddMethod · 0.65

Tested by 1

TestFrameCheckInterruptFunction · 0.64