| 593 | ) |
| 594 | |
| 595 | const queueFromBufferOptionsPush = <A, E>( |
| 596 | options?: { readonly bufferSize: "unbounded" } | { |
| 597 | readonly bufferSize?: number | undefined |
| 598 | readonly strategy?: "dropping" | "sliding" | undefined |
| 599 | } | undefined |
| 600 | ): Effect.Effect<Queue.Queue<Array<A> | Exit.Exit<void, E>>> => { |
| 601 | if (options?.bufferSize === "unbounded" || (options?.bufferSize === undefined && options?.strategy === undefined)) { |
| 602 | return Queue.unbounded() |
| 603 | } |
| 604 | switch (options?.strategy) { |
| 605 | case "sliding": |
| 606 | return Queue.sliding(options.bufferSize ?? 16) |
| 607 | default: |
| 608 | return Queue.dropping(options?.bufferSize ?? 16) |
| 609 | } |
| 610 | } |
| 611 | |
| 612 | /** @internal */ |
| 613 | export const asyncPush = <A, E = never, R = never>( |