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