Skip to content

Releases: brainix/pottery

v1.1.0

29 Dec 15:46
Compare
Choose a tag to compare

New Feature: synchronize()

synchronize() is a decorator that allows only one thread to execute a function at a time. Under the hood, synchronize() uses a Redlock, so refer to the Redlock documentation for more details.

What's Changed

  • Choose a random Redis database for unit tests by @brainix in #302
  • Implement and test redlock() decorator by @brainix in #303
  • Choose Redis database 1 for doctests by @brainix in #304
  • Rename redlock() decorator to synchronize() by @brainix in #305
  • Move CI to GitHub Actions by @brainix in #307
  • Skip slow doctests; update status badges by @brainix in #308
  • Author documentation for synchronize() decorator by @brainix in #306

Full Changelog: v1.0.9...v1.1.0

v1.0.9

27 Dec 01:31
Compare
Choose a tag to compare

Bug Fix: Include typing_extensions in install_requires

Without making Pottery depend on typing_extensions, Pottery fails to install correctly.

Reported in #299, fixed in #301.

What's Changed

Full Changelog: v1.0.8...v1.0.9

v1.0.8

11 Dec 05:51
Compare
Choose a tag to compare

Bug Fix: ._scan() in RedisCounter._make_counter()

Previously, we were calling ._scan() multiple times, and using only every other ._scan() call's results, and never using encoded_dict.

Now, we're using encoded_dict and not skippinng over every other ._scan() call.

In practice, this meant that RedisCounter.most_common() yielded wrong results. It's fixed in this release.

What's Changed

Full Changelog: v1.0.7...v1.0.8

v1.0.7

06 Dec 06:11
f1f3e35
Compare
Choose a tag to compare

Optimization: When possible, bail out early when quorum achieved

The beating heart of all consensus based distributed algorithms is to scatter a computation across multiple nodes, then to gather their results, then to evaluate whether quorum is achieved.

In some cases, quorum requires gathering all of the nodes' results (e.g., interrogating all nodes for a maximum value for a variable).

But in other cases, quorum requires gathering only n // 2 + 1 nodes' results (e.g., figuring out if > 50% of nodes believe that I'm the owner of a lock).

Implement the logic to "bail out" early when possible, in the latter case.

What's Changed

Full Changelog: v1.0.6...v1.0.7

v1.0.6

04 Dec 09:48
Compare
Choose a tag to compare

Quality of Life: Improve logging for Redlock and NextId distributed algorithms

What's Changed

  • Improve logging for distributed algorithms by @brainix in #284
  • Instead of Exception, catch only RedisError by @brainix in #285

Full Changelog: v1.0.5...v1.0.6

v1.0.5

04 Dec 07:15
Compare
Choose a tag to compare

Optimization: Slightly improve Redlock and NextId initialization

  • Previously, we were storing Lua scripts on instances and re-registering them on every instantiation
  • Now, we store Lua scripts on classes and register them on only the first instantiation

What's Changed

  • Save Lua scripts as class vars; register them once by @brainix in #283

Full Changelog: v1.0.4...v1.0.5

v1.0.4

03 Dec 01:54
9fd1f94
Compare
Choose a tag to compare
  1. Optimization: Define __slots__ on ContextTimer
    • This makes ContextTimer objects slightly smaller and attribute lookups slightly faster
  2. Quality of Life: By default, set expiration on CachedOrderedDicts
    • Prior to this, if you had a large keyspace, your CachedOrderedDict could've grown unbounded
    • The timeout defaults to 1 minute
    • The timeout gets reset back to 1 minute every time you set a key
    • If your keyspace has a known/controlled cardinality, you can disable the timeout by passing timeout=None to CachedOrderedDict.__init__()

What's Changed

Full Changelog: v1.0.3...v1.0.4

v1.0.3

25 Nov 07:14
Compare
Choose a tag to compare

Breaking Change: In CachedOrderedDict.__init__(), rename arguments

  • redis β†’ redis_client
  • key β†’ redis_key
  • keys β†’ dict_keys

What's Changed

  • In CachedOrderedDict.init(), rename args by @brainix in #275

Full Changelog: v1.0.2...v1.0.3

v1.0.2

23 Nov 01:11
Compare
Choose a tag to compare

Bug Fix: Don't auto-release Redlock on instance destruction

What's Changed

  • Don't auto-release Redlock on instance destruction by @brainix in #274

Full Changelog: v1.0.1...v1.0.2

v1.0.1

23 Nov 00:03
Compare
Choose a tag to compare
  1. Breaking Change: In BloomFilter.__init__(), rename num_values argument to num_elements
  2. Optimization: Auto-release Redlock on instance destruction
  3. Quality of Life: Bump log level for self-assigning keys from INFO to WARNING
  4. Documentation: Usage for RedisCounter, RedisDeque, redis_cache(), CachedOrderedDict

What's Changed

Full Changelog: v1.0.0...v1.0.1