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