MCPcopy Index your code
hub / github.com/Effect-TS/effect / make

Function make

packages/effect/src/FiberSet.ts:117–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115 * @categories constructors
116 */
117export const make = <A = unknown, E = unknown>(): Effect.Effect<FiberSet<A, E>, never, Scope.Scope> =>
118 Effect.acquireRelease(
119 Effect.map(Deferred.make<void, unknown>(), (deferred) => unsafeMake(new Set(), deferred)),
120 (set) =>
121 Effect.withFiberRuntime((parent) => {
122 const state = set.state
123 if (state._tag === "Closed") return Effect.void
124 set.state = { _tag: "Closed" }
125 const fibers = state.backing
126 return Fiber.interruptAllAs(fibers, FiberId.combine(parent.id(), internalFiberId)).pipe(
127 Effect.intoDeferred(set.deferred)
128 )
129 })
130 )
131
132/**
133 * Create an Effect run function that is backed by a FiberSet.

Callers 2

makeRuntimeFunction · 0.70
makeRuntimePromiseFunction · 0.70

Calls 6

unsafeMakeFunction · 0.70
mapMethod · 0.65
makeMethod · 0.65
pipeMethod · 0.65
combineMethod · 0.65
idMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…