(key: Key, value: Value)
| 500 | } |
| 501 | |
| 502 | set(key: Key, value: Value): Effect.Effect<void> { |
| 503 | return effect.clockWith((clock) => |
| 504 | core.sync(() => { |
| 505 | const now = clock.unsafeCurrentTimeMillis() |
| 506 | const k = key |
| 507 | const lookupResult = Exit.succeed(value) |
| 508 | const mapValue = complete( |
| 509 | makeMapKey(k), |
| 510 | lookupResult, |
| 511 | makeEntryStats(now), |
| 512 | now + Duration.toMillis(Duration.decode(this.timeToLive(lookupResult))) |
| 513 | ) |
| 514 | MutableHashMap.set( |
| 515 | this.cacheState.map, |
| 516 | k, |
| 517 | mapValue as Complete<Key, Value, Error> |
| 518 | ) |
| 519 | }) |
| 520 | ) |
| 521 | } |
| 522 | |
| 523 | get size(): Effect.Effect<number> { |
| 524 | return core.sync(() => { |
nothing calls this directly
no test coverage detected