Skip to content

Releases: motoki317/sc

v1.8.1

12 Apr 07:54
74a85af
Compare
Choose a tag to compare

Changes

  • Pure documentation update. No changes to the source code.

Full Changelog: v1.8.0...v1.8.1

v1.8.0

25 Mar 11:10
42c201c
Compare
Choose a tag to compare

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 supply context.Background() to keep the old behavior.
    • This should better support use-cases like distributed tracing.

Full Changelog: v1.7.1...v1.8.0

v1.7.1

11 Nov 05:27
bad4ef1
Compare
Choose a tag to compare

Changes

  • Pure documentation update, no update to codebase

Full Changelog: v1.7.0...v1.7.1

v1.7.0

05 Nov 13:04
bc4af87
Compare
Choose a tag to compare

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

05 Jun 13:35
391cae4
Compare
Choose a tag to compare

Changes

  • Added GetIfExists method to cache

Full Changelog: v1.5.0...v1.6.0

v1.5.0

24 Sep 09:37
c269144
Compare
Choose a tag to compare

Changes

  • Added ForgetIf method to cache

v1.4.2

05 May 11:27
5651606
Compare
Choose a tag to compare

Improvements

  • Improved (more accurate) documentation of exposed APIs
  • Internal code refactor
  • Use int64 for recording time internally - this allows better GC performance if map backend is used and there is no pointer in your data

v1.4.1

04 May 02:42
d920d6a
Compare
Choose a tag to compare

Bug fixes

  • Stop the ticker of cleaner if cache is no longer referenced

v1.4.0

03 May 17:18
90c1e58
Compare
Choose a tag to compare

Breaking changes

  • Removed GetFresh method to decrease complexity of the interface.
    • You should instead change freshFor and ttl values to control the 'graceful cache replacement' behavior.
  • Removed WithCapacity option, and made WithMapBackend require initial capacity for more consistency with other options.

Improvements

  • Added cache cleaner (WithCleanupInterval) option. See the corresponding doc for more info.

v1.3.0

20 Apr 12:26
004e7ad
Compare
Choose a tag to compare

Changes

  • Breaking: the cache passes empty context on asynchronous value fetch, or graceful cache replacement.