refactor: Update Client.run to have a better async I/O usage#2645
refactor: Update Client.run to have a better async I/O usage#2645DA-344 wants to merge 79 commits into
Client.run to have a better async I/O usage#2645Conversation
Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: DA344 <108473820+DA-344@users.noreply.github.com>
Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: DA344 <108473820+DA-344@users.noreply.github.com>
|
Applied all the changes Dorukyum requested. Before merging, I would like some feedback on this discussion message |
plun1331
left a comment
There was a problem hiding this comment.
This looks like it refactors a large amount of ext.tasks, much of it unrelated to asyncio usage. That should be in a different pull request.
| loop: asyncio.AbstractEventLoop | None = None, | ||
| name: str | None = MISSING, | ||
| overlap: bool | int = False, | ||
| create_loop: bool = False, |
There was a problem hiding this comment.
Technically makes this breaking I believe. True default probably wouldn't be most ideal though?
There was a problem hiding this comment.
it wouldn't be breaking as long as Client.start is called.
| **options: Any, | ||
| ) -> None: | ||
| self.loop: asyncio.AbstractEventLoop = loop | ||
| self.loop: asyncio.AbstractEventLoop = loop or MISSING |
There was a problem hiding this comment.
Is there a difference between using None and MISSING here?
There was a problem hiding this comment.
there is no difference here tbh, but it is done to prevent assert state.loop is not None everytime state.loop is accessed.
|
Could you take a look at #2873 (comment) ? |
…o fix/client-run
Signed-off-by: DA344 <108473820+DA-344@users.noreply.github.com>
25347b5 to
cc6ebbb
Compare
45025bd to
01e9fa8
Compare
Summary
This PR refactors the
Client.runlogic to fix problems involving asyncio due to how the library used the loop:Needs testing
Exception
Information
examples, ...).
Checklist
type: ignorecomments were used, a comment is also left explaining why.