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

Method entryStats

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

Source from the content-addressed store, hash-verified

370 }
371
372 entryStats(key: Key): Effect.Effect<Option.Option<Cache.EntryStats>> {
373 return core.sync(() => {
374 const option = MutableHashMap.get(this.cacheState.map, key)
375 if (Option.isSome(option)) {
376 switch (option.value._tag) {
377 case "Complete": {
378 const loaded = option.value.entryStats.loadedMillis
379 return Option.some(makeEntryStats(loaded))
380 }
381 case "Pending": {
382 return Option.none()
383 }
384 case "Refreshing": {
385 const loaded = option.value.complete.entryStats.loadedMillis
386 return Option.some(makeEntryStats(loaded))
387 }
388 }
389 }
390 return Option.none()
391 })
392 }
393
394 getEither(key: Key): Effect.Effect<Either.Either<Value, Value>, Error> {
395 return core.suspend((): Effect.Effect<Either.Either<Value, Value>, Error> => {

Callers

nothing calls this directly

Calls 3

makeEntryStatsFunction · 0.85
syncMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected