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

Method newAsyncFrame

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

438// newAsyncFrame creates an ExecutionFrame configured for asynchronous evaluation under the
439// given context, wiring the observer and concurrency limit from the program options.
440func (p *prog) newAsyncFrame(ctx context.Context, input any) (*interpreter.ExecutionFrame, error) {
441 frame, err := p.newExecutionFrame(input)
442 if err != nil {
443 return nil, err
444 }
445 if err := frame.SetContext(ctx, p.interruptCheckFrequency); err != nil {
446 frame.Close()
447 return nil, err
448 }
449 frame.SetAsyncObserver(p.asyncObserver)
450 frame.SetAsyncMaxConcurrency(resolveAsyncMaxConcurrency(p.asyncMaxConcurrency))
451 return frame, nil
452}
453
454// defaultAsyncMaxConcurrency bounds the number of concurrently launched async calls when the
455// 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