Skip to content

Commit

Permalink
Merge pull request #225 from moka-rs/prepare-0.10.0
Browse files Browse the repository at this point in the history
Prepare for v0.10.0
  • Loading branch information
tatsuya6502 authored Feb 7, 2023
2 parents 142783e + e3d6735 commit 1b6733f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 37 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Moka Cache — Change Log

## Version 0.10.0

### Breaking Changes

- The following caches have been moved to a separate crate called
[Mini-Moka][mini-moka-crate]:
- `moka::unsync::Cache``mini_moka::unsync::Cache`
- `moka::dash::Cache``mini_moka::sync::Cache`
- The following methods have been removed from `sync` and `future` caches
([#199][gh-pull-0199]). They were deprecated in v0.8.0:
- `get_or_insert_with` (Use `get_with` instead)
- `get_or_try_insert_with` (Use `try_get_with` instead)
- The following methods of `sync` and `future` caches have been marked as deprecated
([#193][gh-pull-0193]):
- `get_with_if` (Use `entry` API's `or_insert_with_if` instead)

### Added

- Add `entry` and `entry_by_ref` APIs to `sync` and `future` caches
([#193][gh-pull-0193]):
- They allow users to perform more complex operations on a cache entry. At this
point, the following operations (methods) are provided:
- `or_default`
- `or_insert`
- `or_insert_with`
- `or_insert_with_if`
- `or_optionally_insert_with`
- `or_try_insert_with`
- The above methods return `Entry` type, which provides `is_fresh` method to
check if the value was freshly computed or already existed in the cache.


## Version 0.9.7

### Fixed
Expand Down Expand Up @@ -522,6 +554,7 @@ The minimum supported Rust version (MSRV) is now 1.51.0 (2021-03-25).
<!-- Links -->

[caffeine-git]: https://github.com/ben-manes/caffeine
[mini-moka-crate]: https://crates.io/crates/mini-moka
[quanta-crate]: https://crates.io/crates/quanta

[panic_in_quanta]: https://github.com/moka-rs/moka#integer-overflow-in-quanta-crate-on-some-x86_64-machines
Expand Down Expand Up @@ -557,7 +590,9 @@ The minimum supported Rust version (MSRV) is now 1.51.0 (2021-03-25).
[gh-issue-0031]: https://github.com/moka-rs/moka/issues/31/

[gh-pull-0216]: https://github.com/moka-rs/moka/pull/216/
[gh-pull-0199]: https://github.com/moka-rs/moka/pull/199/
[gh-pull-0195]: https://github.com/moka-rs/moka/pull/195/
[gh-pull-0193]: https://github.com/moka-rs/moka/pull/193/
[gh-pull-0190]: https://github.com/moka-rs/moka/pull/190/
[gh-pull-0189]: https://github.com/moka-rs/moka/pull/189/
[gh-pull-0187]: https://github.com/moka-rs/moka/pull/187/
Expand Down
36 changes: 0 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,35 +478,6 @@ cases, increasing MSRV is _not_ considered a semver-breaking change.

## Troubleshooting

### Integer Overflow in Quanta Crate on Some x86_64 Machines

Quanta crate up to v0.9.3 has an issue on some specific x86_64-based machines. It
will cause intermittent panic due to integer overflow:

- metrics-rs/quanta &mdash; [Intermittent panic due to overflowing our source calibration denominator. #61](https://github.com/metrics-rs/quanta/issues/61)
(Fixed by Quanta v0.10.0)

The overflows have been reported by a couple of users who use AMD-based Lenovo
laptops or Circle CI.

When this issue occurs, you will get a stacktrace containing the following lines:

```console
... panicked at 'attempt to add with overflow', ...
...
quanta::Calibration::calibrate
at ... /quanta-0.9.3/src/lib.rs:226:13
quanta::Clock::new::{{closure}}
at ... /quanta-0.9.3/src/lib.rs:307:17
...
```

This issue was fixed by Quanta v0.10.0.

You can prevent the issue by upgrading Moka to v0.8.4 or newer, which depends on
Quanta v0.10.0 or newer.


### Compile Errors on Some 32-bit Platforms

On some 32-bit target platforms including the followings, you may encounter compile
Expand Down Expand Up @@ -636,10 +607,3 @@ at your option.
See [LICENSE-MIT](LICENSE-MIT) and [LICENSE-APACHE](LICENSE-APACHE) for details.

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmoka-rs%2Fmoka.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmoka-rs%2Fmoka?ref=badge_large)

<!--
MEMO:
- Column width is 85. (Emacs: C-x f)
-->
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
//! [sync-seg-cache-struct]: ./sync/struct.SegmentedCache.html
//!
//! **NOTE:** The following caches have been moved to a separate crate called
//! "[mini-moka][mini-moka-crate]"".
//! "[mini-moka][mini-moka-crate]".
//!
//! - Non concurrent cache for single threaded applications:
//! - `moka::unsync::Cache` → [`mini_moka::unsync::Cache`][unsync-cache-struct]
Expand Down

0 comments on commit 1b6733f

Please sign in to comment.