This repository has been archived by the owner on Feb 21, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What do these changes do?
The new 2.0 implementation has a number of places where it either takes an explicit loop parameter, or passes one to an asyncio function. The need for this was largely removed in Python 3.5.3 (because get_event_loop was changed to return the event loop of the current task when called from inside a task), and many functions (such as wait_for deprecated the parameter in 3.8 with removal for 3.10. Other functions (like open_connection) didn't deprecate it, but made it optional and documented that it is not needed when called from a coroutine. I wouldn't be surprised if they are deprecated in future.
Are there changes in behavior for the user?
Only compared to 2.0.0a1:
__del__
will now always use asyncio.get_event_loop(). But__del__
is broken anyway, for reasons I've explained in Migration to aioredis 2.0 #930.PubSub.run_in_thread is a synchronous function but needs to know the event loop to run. I've updated it to take an explicit loop argument. This makes it possible to construct the Redis object before the event loop. I'm going to file a separate issue to remove this function anyway, since aioredis should provide concurrency via asyncio tasks rather than threads, and the one test function has been disabled because it is broken.
Related issue number
#1002
Checklist
CONTRIBUTORS.txt
<Name> <Surname>
.CHANGES/
folder<issue_id>.<type>
(e.g.588.bugfix
)issue_id
change it to the pr id after creating the PR.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.Fix issue with non-ascii contents in doctest text files.