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

Method newAsyncFrame

cel/program.go:576–588  ·  view source on GitHub ↗

newAsyncFrame creates an ExecutionFrame configured for asynchronous evaluation under the given context, wiring the observer and concurrency limit from the program options.

(ctx context.Context, input any)

Source from the content-addressed store, hash-verified

574// newAsyncFrame creates an ExecutionFrame configured for asynchronous evaluation under the
575// given context, wiring the observer and concurrency limit from the program options.
576func (p *prog) newAsyncFrame(ctx context.Context, input any) (*interpreter.ExecutionFrame, error) {
577 frame, err := p.newExecutionFrame(input)
578 if err != nil {
579 return nil, err
580 }
581 if err := frame.SetContext(ctx, p.interruptCheckFrequency); err != nil {
582 frame.Close()
583 return nil, err
584 }
585 frame.SetAsyncObserver(p.asyncObserver)
586 frame.SetAsyncMaxConcurrency(resolveAsyncMaxConcurrency(p.asyncMaxConcurrency))
587 return frame, nil
588}
589
590// defaultAsyncMaxConcurrency bounds the number of concurrently launched async calls when the
591// program does not configure AsyncMaxConcurrency. It exists so that a wide fan-out (e.g. an async

Callers 1

ConcurrentEvalMethod · 0.95

Calls 6

newExecutionFrameMethod · 0.95
SetContextMethod · 0.80
CloseMethod · 0.80
SetAsyncObserverMethod · 0.80

Tested by

no test coverage detected