Skip to content

Commit 38c9699

Browse files
committed
Update changelog, and README to highlight removal of FakeTimeSource.
1 parent eb16022 commit 38c9699

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Change Log
22

3-
## 0.6.0
3+
## Unreleased
44

55
### Changed
66

7-
- Time Source can be provided externally
7+
- `fakeTimeSource` in `Cache.Builder` has been renamed to `timeSource`, and the `FakeTimeSource` implementation has been removed (still available in our tests) - [#20](https://github.com/ReactiveCircus/cache4k/pull/20)
8+
- Kotlin 1.6.21.
89

910
## 0.5.0
1011

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ cache.invalidateAll()
196196

197197
### Unit testing cache expirations
198198

199-
To test logic that depends on cache expiration, pass in a `FakeTimeSource` when building a `Cache`
199+
To test logic that depends on cache expiration, pass in a fake `TimeSource` implementation when building a `Cache`
200200
so you can programmatically advance the reading of the time source:
201201

202202
```kotlin
@@ -224,6 +224,8 @@ fun cacheEntryEvictedAfterExpiration() {
224224
}
225225
```
226226

227+
A sample `FakeTimeSource` implementation can be found in [our tests](https://github.com/ReactiveCircus/cache4k/blob/8376a5f6198b3d8f82f42184fd1cabe4aa08e754/cache4k/src/commonTest/kotlin/io/github/reactivecircus/cache4k/FakeTimeSource.kt).
228+
227229
## Credits
228230

229231
The library was ported from a kotlin / JVM cache which I contributed to [dropbox/Store](https://github.com/dropbox/Store) to help unblock Store's multiplatform support (

cache4k/src/commonTest/kotlin/io/github/reactivecircus/cache4k/FakeTimeSource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import kotlin.time.DurationUnit
1212
*
1313
* Implementation is identical to [kotlin.time.TestTimeSource] except the internal [reading] is an [AtomicLong].
1414
*/
15-
public class FakeTimeSource : AbstractLongTimeSource(unit = DurationUnit.NANOSECONDS) {
15+
class FakeTimeSource : AbstractLongTimeSource(unit = DurationUnit.NANOSECONDS) {
1616

1717
private val reading = atomic(0L)
1818

0 commit comments

Comments
 (0)