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

Function newAsyncGate

interpreter/async.go:469–478  ·  view source on GitHub ↗
(maxConcurrency int, completions chan<- int64)

Source from the content-addressed store, hash-verified

467}
468
469func newAsyncGate(maxConcurrency int, completions chan<- int64) *asyncGate {
470 var sem chan struct{}
471 if maxConcurrency > 0 {
472 sem = make(chan struct{}, maxConcurrency)
473 }
474 return &asyncGate{
475 semaphore: sem,
476 completions: completions,
477 }
478}
479
480// TryAcquire attempts to acquire a concurrency slot and increments the active calls count.
481func (g *asyncGate) TryAcquire() bool {

Calls

no outgoing calls