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

Function make

packages/effect/src/PubSub.ts:278–293  ·  view source on GitHub ↗
(
  options: {
    readonly atomicPubSub: LazyArg<PubSub.Atomic<A>>
    readonly strategy: LazyArg<PubSub.Strategy<A>>
  }
)

Source from the content-addressed store, hash-verified

276 * @since 4.0.0
277 */
278export const make = <A>(
279 options: {
280 readonly atomicPubSub: LazyArg<PubSub.Atomic<A>>
281 readonly strategy: LazyArg<PubSub.Strategy<A>>
282 }
283): Effect.Effect<PubSub<A>> =>
284 Effect.sync(() =>
285 makePubSubUnsafe(
286 options.atomicPubSub(),
287 new Map(),
288 Scope.makeUnsafe(),
289 Latch.makeUnsafe(false),
290 MutableRef.make(false),
291 options.strategy()
292 )
293 )
294
295/**
296 * Creates a bounded `PubSub` that applies backpressure when it reaches

Callers 4

boundedFunction · 0.70
droppingFunction · 0.70
slidingFunction · 0.70
unboundedFunction · 0.70

Calls 3

makePubSubUnsafeFunction · 0.85
makeMethod · 0.65
syncMethod · 0.45

Tested by

no test coverage detected