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

Method getOptionComplete

packages/effect/src/internal/cache.ts:354–366  ·  view source on GitHub ↗
(key: Key)

Source from the content-addressed store, hash-verified

352 }
353
354 getOptionComplete(key: Key): Effect.Effect<Option.Option<Value>> {
355 return core.suspend(() =>
356 Option.match(MutableHashMap.get(this.cacheState.map, key), {
357 onNone: () => {
358 const mapKey = makeMapKey(key)
359 this.trackAccess(mapKey)
360 this.trackMiss()
361 return core.succeed(Option.none<Value>())
362 },
363 onSome: (value) => this.resolveMapValue(value, true) as Effect.Effect<Option.Option<Value>>
364 })
365 )
366 }
367
368 contains(key: Key): Effect.Effect<boolean> {
369 return core.sync(() => MutableHashMap.has(this.cacheState.map, key))

Callers

nothing calls this directly

Calls 5

trackAccessMethod · 0.95
trackMissMethod · 0.95
resolveMapValueMethod · 0.95
makeMapKeyFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected