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

Method SetAsyncMaxConcurrency

interpreter/frame.go:307–317  ·  view source on GitHub ↗

SetAsyncMaxConcurrency sets the maximum concurrency for asynchronous function calls. A non-positive value indicates that concurrency is unbounded.

(n int)

Source from the content-addressed store, hash-verified

305//
306// A non-positive value indicates that concurrency is unbounded.
307func (f *ExecutionFrame) SetAsyncMaxConcurrency(n int) error {
308 if f.ctx == nil {
309 return errors.New("asynchronous evaluation options require the execution frame to have a context configured")
310 }
311 if n > 0 {
312 f.ctx.gate.semaphore = make(chan struct{}, n)
313 } else {
314 f.ctx.gate.semaphore = nil
315 }
316 return nil
317}
318
319// frameStack provides a synchronized pool of ExecutionFrames.
320var frameStack = &sync.Pool{

Callers 3

newAsyncFrameMethod · 0.80

Calls 1

NewMethod · 0.80

Tested by 2