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

Method newAsyncFrame

cel/program.go:457–469  ·  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

455// newAsyncFrame creates an ExecutionFrame configured for asynchronous evaluation under the
456// given context, wiring the observer and concurrency limit from the program options.
457func (p *prog) newAsyncFrame(ctx context.Context, input any) (*interpreter.ExecutionFrame, error) {
458 frame, err := p.newExecutionFrame(input)
459 if err != nil {
460 return nil, err
461 }
462 if err := frame.SetContext(ctx, p.interruptCheckFrequency); err != nil {
463 frame.Close()
464 return nil, err
465 }
466 frame.SetAsyncObserver(p.asyncObserver)
467 frame.SetAsyncMaxConcurrency(resolveAsyncMaxConcurrency(p.asyncMaxConcurrency))
468 return frame, nil
469}
470
471// defaultAsyncMaxConcurrency bounds the number of concurrently launched async calls when the
472// 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