( concurrency: number | "unbounded" | undefined, sequential: () => A, bounded: (n: number) => A )
| 2785 | |
| 2786 | /** @internal */ |
| 2787 | export const matchConcurrency = <A>( |
| 2788 | concurrency: number | "unbounded" | undefined, |
| 2789 | sequential: () => A, |
| 2790 | bounded: (n: number) => A |
| 2791 | ) => { |
| 2792 | switch (concurrency) { |
| 2793 | case undefined: |
| 2794 | return sequential() |
| 2795 | case "unbounded": |
| 2796 | return bounded(Number.MAX_SAFE_INTEGER) |
| 2797 | default: |
| 2798 | return concurrency > 1 ? bounded(concurrency) : sequential() |
| 2799 | } |
| 2800 | } |
| 2801 | |
| 2802 | const flatMapParSwitchBuffer = dual< |
| 2803 | <A, A2, E2, R2>( |
no test coverage detected