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

Method resolveCompletionBufferSize

cel/program.go:610–620  ·  view source on GitHub ↗

resolveCompletionBufferSize returns the size of the async completion channel. When unset, it defaults to the effective launch concurrency so that all in-flight calls can report completion without blocking. An unbuffered channel would make a completed call hold its launch slot until the evaluator dra

()

Source from the content-addressed store, hash-verified

608// without blocking. An unbuffered channel would make a completed call hold its launch slot until
609// the evaluator drained it, throttling effective concurrency to the drain rate.
610func (p *prog) resolveCompletionBufferSize() int {
611 if p.asyncCompletionBufferSize > 0 {
612 return p.asyncCompletionBufferSize
613 }
614 limit := resolveAsyncMaxConcurrency(p.asyncMaxConcurrency)
615 if limit < 0 {
616 // Unlimited launches: fall back to the default bound for the buffer so it stays finite.
617 return defaultAsyncMaxConcurrency
618 }
619 return limit
620}
621
622// ConcurrentEval implements the Program interface.
623func (p *prog) ConcurrentEval(ctx context.Context, input any) <-chan EvalResult {

Callers 1

ConcurrentEvalMethod · 0.95

Calls 1

Tested by

no test coverage detected