AsyncMaxConcurrency sets the maximum number of concurrently launched async calls during ConcurrentEval. This bounds the number of in-flight async goroutines, so a wide fan-out (such as an async call inside a comprehension over a large list) cannot exhaust memory. A value of 0 (unset) applies a buil
(maxConcurrency int)
| 838 | // A negative value disables the limiter (unbounded launches) and should only be used when |
| 839 | // concurrency is bounded by other means. |
| 840 | func AsyncMaxConcurrency(maxConcurrency int) ProgramOption { |
| 841 | return func(p *prog) (*prog, error) { |
| 842 | p.asyncMaxConcurrency = maxConcurrency |
| 843 | return p, nil |
| 844 | } |
| 845 | } |
| 846 | |
| 847 | // ConcurrentDrainStrategy configures the strategy for when to re-evaluate the program |
| 848 | // during a ConcurrentEval call after receiving asynchronous completion signals. |
no outgoing calls