| 597 | ) |
| 598 | |
| 599 | const mailboxFromBufferOptionsPush = <A, E>( |
| 600 | options?: { readonly bufferSize: "unbounded" } | { |
| 601 | readonly bufferSize?: number | undefined |
| 602 | readonly strategy?: "dropping" | "sliding" | undefined |
| 603 | } | undefined |
| 604 | ): Effect.Effect<Mailbox.Mailbox<A, E>> => { |
| 605 | if (options?.bufferSize === "unbounded" || (options?.bufferSize === undefined && options?.strategy === undefined)) { |
| 606 | return mailbox.make() |
| 607 | } |
| 608 | return mailbox.make({ |
| 609 | capacity: options?.bufferSize ?? 16, |
| 610 | strategy: options?.strategy ?? "dropping" |
| 611 | }) |
| 612 | } |
| 613 | |
| 614 | /** @internal */ |
| 615 | export const asyncPush = <A, E = never, R = never>( |