(self: Cache<Key, A, E, R>)
| 1314 | * @since 4.0.0 |
| 1315 | */ |
| 1316 | export const keys = <Key, A, E, R>(self: Cache<Key, A, E, R>): Effect.Effect<Iterable<Key>> => |
| 1317 | core.withFiber((fiber) => { |
| 1318 | const now = fiber.getRef(effect.ClockRef).currentTimeMillisUnsafe() |
| 1319 | return effect.succeed(Iterable.filterMap(self.map, ([key, entry]) => { |
| 1320 | if (entry.expiresAt === undefined || entry.expiresAt > now) { |
| 1321 | return Result.succeed(key) |
| 1322 | } |
| 1323 | MutableHashMap.remove(self.map, key) |
| 1324 | return Result.failVoid |
| 1325 | })) |
| 1326 | }) |
| 1327 | |
| 1328 | /** |
| 1329 | * Retrieves all successfully cached values from the cache, excluding failed |
nothing calls this directly
no test coverage detected