| 47 | } |
| 48 | |
| 49 | class 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 */ |
| 74 | export const make: { |
nothing calls this directly
no outgoing calls
no test coverage detected