Releases: motoki317/sc
Releases · motoki317/sc
v1.8.1
v1.8.0
Changes
- Added size-related statistics to Stats() method.
- Contexts passed to replaceFn no longer propagates cancellation signals.
- Cancel propagation inside request coalescing is not usually desirable, as it represents multiple value requests. If only one request that initiated the replaceFn call cancels the context, all other waiting goroutines get the same "context canceled" error, which is usually not something desirable.
- The library now requires Go >= 1.21 as it uses
context.WithoutCancel()
.
- Allow context value propagation (but without cancel propagation) for all replaceFn call paths, including background update.
- BREAKING This change breaks the signature of
Notify()
method, but you can just supplycontext.Background()
to keep the old behavior. - This should better support use-cases like distributed tracing.
- BREAKING This change breaks the signature of
Full Changelog: v1.7.1...v1.8.0
v1.7.1
v1.7.0
Changes
- Added
Notify()
method to cache- Useful for notifying value replacement in a non-blocking manner
- The cache now has a cleaner by default
- Note that this is NOT a breaking behavior in any way, except for a possible slight performance impact.
- Improve documentation (mainly of StrictCoalescing option)
Full Changelog: v1.6.0...v1.7.0
v1.6.0
v1.5.0
v1.4.2
v1.4.1
v1.4.0
Breaking changes
- Removed
GetFresh
method to decrease complexity of the interface.- You should instead change
freshFor
andttl
values to control the 'graceful cache replacement' behavior.
- You should instead change
- Removed
WithCapacity
option, and madeWithMapBackend
require initial capacity for more consistency with other options.
Improvements
- Added cache cleaner (
WithCleanupInterval
) option. See the corresponding doc for more info.