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)
| 574 | // newAsyncFrame creates an ExecutionFrame configured for asynchronous evaluation under the |
| 575 | // given context, wiring the observer and concurrency limit from the program options. |
| 576 | func (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 |
no test coverage detected