Releases: brainix/pottery
v1.1.0
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
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
- Improve exception logging in NextId and Redlock by @brainix in #294
- Upgrade requirements by @brainix in #295
- Upgrade Python to 3.9.1 by @brainix in #296
- Add Typing :: Typed Trove classifier by @brainix in #297
- Upgrade requirements by @brainix in #298
- In unit tests, explicitly pass in the Redis client by @brainix in #300
- Include typing_extensions in install_requires by @brainix in #301
Full Changelog: v1.0.8...v1.0.9
v1.0.8
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
- Author docstring for BailOutExecutor by @brainix in #288
- Don't bail out from NextId.__current_id getter by @brainix in #289
- Refactor Makefile by @brainix in #291
- Clean up Redis after doctesting README.md by @brainix in #292
- Fix ._scan() bug in RedisCounter._make_counter() by @brainix in #293
Full Changelog: v1.0.7...v1.0.8
v1.0.7
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
- When possible, bail out early when quorum achieved by @brainix in #286
- Bump version number by @brainix in #287
Full Changelog: v1.0.6...v1.0.7
v1.0.6
v1.0.5
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
Full Changelog: v1.0.4...v1.0.5
v1.0.4
- Optimization: Define
__slots__
onContextTimer
- This makes
ContextTimer
objects slightly smaller and attribute lookups slightly faster
- This makes
- Quality of Life: By default, set expiration on
CachedOrderedDict
s- 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
toCachedOrderedDict.__init__()
- Prior to this, if you had a large keyspace, your
What's Changed
- Create codeql-analysis.yml by @brainix in #276
- Add CodeQL status badge by @brainix in #277
- Define slots on ContextTimer by @brainix in #278
- In random_key(), type/value check num_tries by @brainix in #279
- By default, set expiration on CachedOrderedDicts by @brainix in #280
- Test self-assigned keys get del when out of scope by @brainix in #281
- Bump version number by @brainix in #282
Full Changelog: v1.0.3...v1.0.4
v1.0.3
v1.0.2
v1.0.1
- Breaking Change: In
BloomFilter.__init__()
, renamenum_values
argument tonum_elements
- Optimization: Auto-release Redlock on instance destruction
- Quality of Life: Bump log level for self-assigning keys from
INFO
toWARNING
- Documentation: Usage for
RedisCounter
,RedisDeque
,redis_cache()
,CachedOrderedDict
What's Changed
- Improve Makefile by @brainix in #256
- Improve README.md by @brainix in #257
- Document HyperLogLog usage by @brainix in #258
- Add dependencies and Python versions badges by @brainix in #259
- Document redis_cache() usage by @brainix in #260
- Migrate from Travis CI .org to .com by @brainix in #261
- Use doctest module to verify examples in README.md by @brainix in #262
- Simplify HyperLogLog.update() by @brainix in #263
- Ensure self, obj are on same Redis before PFMERGE by @brainix in #264
- Delete upgrade Makefile target by @brainix in #265
- Bump log level for self-assigning keys to WARNING by @brainix in #266
- Recreate upgrade Makefile target by @brainix in #267
- Don't repeat myself by @brainix in #268
- Document CachedOrderedDict usage by @brainix in #269
- Improve README.md by @brainix in #270
- Document RedisDeque usage by @brainix in #271
- Auto-release Redlock on instance destruction by @brainix in #272
- In BloomFilter.init(), rename arg num_elements by @brainix in #273
Full Changelog: v1.0.0...v1.0.1