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

Function releaseOwner

packages/effect/src/internal/scopedCache.ts:159–169  ·  view source on GitHub ↗
(
  self: Complete<Key, Value, Error>
)

Source from the content-addressed store, hash-verified

157
158/** @internal */
159export const releaseOwner = <Key, Value, Error = never>(
160 self: Complete<Key, Value, Error>
161): Effect.Effect<void> =>
162 Exit.matchEffect(self.exit, {
163 onFailure: () => core.void,
164 onSuccess: ([, finalizer]) =>
165 core.flatMap(
166 core.sync(() => MutableRef.decrementAndGet(self.ownerCount)),
167 (numOwner) => effect.when(finalizer(Exit.void), () => numOwner === 0)
168 )
169 })
170
171/** @internal */
172const ScopedCacheSymbolKey = "effect/ScopedCache"

Callers 4

toScopedFunction · 0.85
getMethod · 0.85
invalidateMethod · 0.85
cleanMapValueMethod · 0.85

Calls 2

syncMethod · 0.80
finalizerFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…