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

Function AsyncMaxConcurrency

cel/options.go:840–845  ·  view source on GitHub ↗

AsyncMaxConcurrency sets the maximum number of concurrently launched async calls during ConcurrentEval. This bounds the number of in-flight async goroutines, so a wide fan-out (such as an async call inside a comprehension over a large list) cannot exhaust memory. A value of 0 (unset) applies a buil

(maxConcurrency int)

Source from the content-addressed store, hash-verified

838// A negative value disables the limiter (unbounded launches) and should only be used when
839// concurrency is bounded by other means.
840func AsyncMaxConcurrency(maxConcurrency int) ProgramOption {
841 return func(p *prog) (*prog, error) {
842 p.asyncMaxConcurrency = maxConcurrency
843 return p, nil
844 }
845}
846
847// ConcurrentDrainStrategy configures the strategy for when to re-evaluate the program
848// during a ConcurrentEval call after receiving asynchronous completion signals.

Callers 1

TestConcurrentEvalFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestConcurrentEvalFunction · 0.74