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

Method SetAsyncMaxConcurrency

interpreter/frame.go:462–472  ·  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

460//
461// A non-positive value indicates that concurrency is unbounded.
462func (f *ExecutionFrame) SetAsyncMaxConcurrency(n int) error {
463 if f.ctx == nil {
464 return errors.New("asynchronous evaluation options require the execution frame to have a context configured")
465 }
466 if n > 0 {
467 f.ctx.gate.semaphore = make(chan struct{}, n)
468 } else {
469 f.ctx.gate.semaphore = nil
470 }
471 return nil
472}
473
474// frameStack provides a synchronized pool of ExecutionFrames.
475var frameStack = &sync.Pool{

Callers 3

newAsyncFrameMethod · 0.80

Calls 1

NewMethod · 0.80

Tested by 2