( concurrency: number | "unbounded" | undefined, sequential: () => A, bounded: (n: number) => A )
| 2792 | |
| 2793 | /** @internal */ |
| 2794 | export const matchConcurrency = <A>( |
| 2795 | concurrency: number | "unbounded" | undefined, |
| 2796 | sequential: () => A, |
| 2797 | bounded: (n: number) => A |
| 2798 | ) => { |
| 2799 | switch (concurrency) { |
| 2800 | case undefined: |
| 2801 | return sequential() |
| 2802 | case "unbounded": |
| 2803 | return bounded(Number.MAX_SAFE_INTEGER) |
| 2804 | default: |
| 2805 | return concurrency > 1 ? bounded(concurrency) : sequential() |
| 2806 | } |
| 2807 | } |
| 2808 | |
| 2809 | const flatMapParSwitchBuffer = dual< |
| 2810 | <A, A2, E2, R2>( |
no test coverage detected
searching dependent graphs…