Fix event loop binding
What do these changes do?
In a multithreaded environment, it is possible that nowait methods may be called in event loops other than the one in which asynchronous methods are called. As a result, simultaneous binding to two different event loops is possible, because of which some methods will not work. This PR fixes this bug and ensures that RuntimeError is safely raised.
Side effect: nowait methods no longer depend on the event loop (and do not raise a RuntimeError when used from a different event loop).
Are there changes in behavior for the user?
There are no behavior changes for users.
CodSpeed Performance Report
Merging #727 will not alter performance
Comparing x42005e1f:fix-event-loop-binding (dff6070) with master (8ab8405)
Summary
✅ 4 untouched benchmarks
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.40%. Comparing base (
8ab8405) to head (dff6070).
Additional details and impacted files
@@ Coverage Diff @@
## master #727 +/- ##
==========================================
- Coverage 95.40% 95.40% -0.01%
==========================================
Files 5 5
Lines 1721 1719 -2
Branches 154 154
==========================================
- Hits 1642 1640 -2
Misses 52 52
Partials 27 27
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.