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

Method CheckInterrupt

interpreter/frame.go:214–232  ·  view source on GitHub ↗

CheckInterrupt returns whether the evaluation has been interrupted.

()

Source from the content-addressed store, hash-verified

212
213// CheckInterrupt returns whether the evaluation has been interrupted.
214func (f *ExecutionFrame) CheckInterrupt() bool {
215 if f.ctx == nil {
216 return false
217 }
218 if f.ctx.interrupted.Load() {
219 return true
220 }
221 count := f.ctx.interruptCheckCount.Add(1)
222 if f.ctx.interruptCheckFrequency > 0 && count%uint64(f.ctx.interruptCheckFrequency) == 0 {
223 select {
224 case <-f.ctx.interrupt:
225 f.ctx.interrupted.Store(true)
226 return true
227 default:
228 return false
229 }
230 }
231 return false
232}
233
234// ComputeResult tracks and computes the result of the given asynchronous function.
235//

Callers 3

foldIterableMethod · 0.80
FoldEntryMethod · 0.80
TestFrameCheckInterruptFunction · 0.80

Calls 1

AddMethod · 0.65

Tested by 1

TestFrameCheckInterruptFunction · 0.64