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

Method CheckInterrupt

interpreter/frame.go:181–199  ·  view source on GitHub ↗

CheckInterrupt returns whether the evaluation has been interrupted.

()

Source from the content-addressed store, hash-verified

179
180// CheckInterrupt returns whether the evaluation has been interrupted.
181func (f *ExecutionFrame) CheckInterrupt() bool {
182 if f.ctx == nil {
183 return false
184 }
185 if f.ctx.interrupted.Load() {
186 return true
187 }
188 count := f.ctx.interruptCheckCount.Add(1)
189 if f.ctx.interruptCheckFrequency > 0 && count%uint64(f.ctx.interruptCheckFrequency) == 0 {
190 select {
191 case <-f.ctx.interrupt:
192 f.ctx.interrupted.Store(true)
193 return true
194 default:
195 return false
196 }
197 }
198 return false
199}
200
201// frameStack provides a synchronized pool of ExecutionFrames.
202var frameStack = &sync.Pool{

Callers 3

foldIterableMethod · 0.80
FoldEntryMethod · 0.80
TestFrameCheckInterruptFunction · 0.80

Calls 1

AddMethod · 0.65

Tested by 1

TestFrameCheckInterruptFunction · 0.64