MCPcopy
hub / github.com/Effect-TS/effect / RcMapImpl

Class RcMapImpl

packages/effect/src/internal/rcMap.ts:49–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49class RcMapImpl<K, A, E> implements RcMap.RcMap<K, A, E> {
50 readonly [TypeId]: RcMap.RcMap.Variance<K, A, E>
51
52 state: State<K, A, E> = {
53 _tag: "Open",
54 map: MutableHashMap.empty()
55 }
56 readonly semaphore = circular.unsafeMakeSemaphore(1)
57
58 constructor(
59 readonly lookup: (key: K) => Effect<A, E, Scope.Scope>,
60 readonly context: Context.Context<never>,
61 readonly scope: Scope.Scope,
62 readonly idleTimeToLive: ((key: K) => Duration.Duration) | undefined,
63 readonly capacity: number
64 ) {
65 this[TypeId] = variance
66 }
67
68 pipe() {
69 return pipeArguments(this, arguments)
70 }
71}
72
73/** @internal */
74export const make: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected