Closed HassanAbouelela closed 2 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
async_rediscache/session.py | 16 | 17 | 94.12% | ||
<!-- | Total: | 135 | 136 | 99.26% | --> |
Totals | |
---|---|
Change from base Build 652299207: | 3.7% |
Covered Lines: | 803 |
Relevant Lines: | 806 |
Thank you, I'll have a look at the PR.
Hey, I've gone through the PR again now and I'm more or less happy with where it was. I was hoping to get a few more reviews and push out a full release soon, but a more realistic approach might be to release this as a beta or RC within the next week, and work on fixing any reported issues.
If that's alright, I'm planning on doing that on Tuesday or so.
Given that the version was 0.2, this is fine to be 0.3 its widely accepted that projects that haven't reached a 1.0 release can be breaking with each minor release.
The bump to 1.0 was to follow the deprecation timeline for the lock decorator. Not that it should matter, this repo is pretty stable and I think a 1.0 should be fine.
This PR migrates the aioredis version required for the library to ~= 2, which introduces a lot of breaking changes. I've documented below what can best be described as a changelog/migration guide. There is also a version bump from 0.2 to 1.0 as aioredis 2 is going to be incompatible with projects which use the old version.
Removed:
RedisSession.pool
RedisSession.closed
(closing sessions is mostly no longer a thing)RedisSessionClosed
exception (same reason as above)namespace_lock
,namespace_lock_no_warn
andNamespaceLock
Changed:
RedisSession
now takes a mandatory URL parameter. Seeaioredis.Redis.from_url
RedisObject.redis_session.client
, which now validates namespace as wellRedisTask
now takes aRedisTaskQueue
instead of just aRedisQueue
.Added
RedisSessionNotConnected
exceptionRedisSession.connected
(can act as a general replacement for closed, since a session will never be closed once created)Connection Pattern Changes
This is where the bulk of the changes lie. aioredis 2.0 abstracts away all the logic for managing the connection and underlying pool (in fact it's nearly impossible to do now, as each pool connection is supposed to be tied directly to a single instruction). This means that all users need to factor out any pool accessing, and instead replace those blocks with direct calls to the client object.
Migration Guide
To migrate from 0.2 to 1.0.0, you need to do the following:
If you use aioredis directly, follow the migration guide here. Unfortunately, the guide is incomplete, and the changelog is almost non-existant. This shouldn't be too difficult to overcome if you have a good static analysis tool however. Here is a (incomplete) list of some undocumented API changes which you might find useful:
brpoplpush
andrpoplpush
no longer takesourcekey
anddestkey
, butsrc
anddst
hmset_dict
has been removed. You can usehset
(orhmset
, but that's deprecated) with themapping
kwarg insteadI have not noticed any other undocumented changes but YMMV.