MCPcopy Create free account
hub / github.com/Effect-TS/effect / mailboxFromBufferOptionsPush

Function mailboxFromBufferOptionsPush

packages/effect/src/internal/stream.ts:599–612  ·  view source on GitHub ↗
(
  options?: { readonly bufferSize: "unbounded" } | {
    readonly bufferSize?: number | undefined
    readonly strategy?: "dropping" | "sliding" | undefined
  } | undefined
)

Source from the content-addressed store, hash-verified

597 )
598
599const 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 */
615export const asyncPush = <A, E = never, R = never>(

Callers 1

asyncPushFunction · 0.85

Calls 1

makeMethod · 0.65

Tested by

no test coverage detected