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

Function invalidateAllImpl

packages/effect/src/ScopedCache.ts:691–701  ·  view source on GitHub ↗
(
  parent: Fiber.Fiber<unknown, unknown>,
  map: MutableHashMap.MutableHashMap<Key, Entry<A, E>>
)

Source from the content-addressed store, hash-verified

689 })
690
691const invalidateAllImpl = <Key, A, E>(
692 parent: Fiber.Fiber<unknown, unknown>,
693 map: MutableHashMap.MutableHashMap<Key, Entry<A, E>>
694): Effect.Effect<void> => {
695 const fibers = Arr.empty<Fiber.Fiber<unknown, unknown>>()
696 for (const [, entry] of map) {
697 fibers.push(effect.forkUnsafe(parent as any, Scope.close(entry.scope, effect.exitVoid), true, true))
698 }
699 MutableHashMap.clear(map)
700 return effect.fiberAwaitAll(fibers)
701}
702
703/**
704 * Retrieves the approximate number of entries in the cache.

Callers 2

makeWithFunction · 0.85
invalidateAllFunction · 0.85

Calls 3

pushMethod · 0.80
clearMethod · 0.80
closeMethod · 0.65

Tested by

no test coverage detected