(self: Enqueue<A, E>, messages: Iterable<A>)
| 760 | * @since 2.0.0 |
| 761 | */ |
| 762 | export const offerAll = <A, E>(self: Enqueue<A, E>, messages: Iterable<A>): Effect<Array<A>> => |
| 763 | internalEffect.suspend(() => { |
| 764 | if (self.state._tag !== "Open") { |
| 765 | return internalEffect.succeed(Arr.fromIterable(messages)) |
| 766 | } |
| 767 | const remaining = offerAllUnsafe(self as Queue<A, E>, messages) |
| 768 | if (remaining.length === 0) { |
| 769 | return core.exitSucceed([]) |
| 770 | } else if (self.strategy === "dropping") { |
| 771 | return internalEffect.succeed(remaining) |
| 772 | } |
| 773 | return offerRemainingArray(self as Queue<A, E>, remaining) |
| 774 | }) |
| 775 | |
| 776 | /** |
| 777 | * Adds multiple messages to the queue synchronously. Returns the remaining messages that |
nothing calls this directly
no test coverage detected