Asyncio Client improvements
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- networking
Research direction
Start with client_aio.py and the AioConnection.connect and AioReactor entry points named in the issue, then review the checklist and existing asynchronous tests. The work is complete only after the selected API, connection-handling, event-loop, locking, throttling, and testing improvements are agreed and implemented without leaving the listed issues unresolved.
Written by the indexing model from the issue text.
Description
After thoroughly examining the module, I found multiple improvements could/should be done to asynchronous code. I'd like to open a discussion before actually implementing the code because some changes will break the current API.
- (breaks API)
AioSimpleIRCClientcurrently cannot be created and started once event loop has started and running asynchronous code, becauseAioConnection.connectcallsloop.run_until_complete. In the situation described above, aRuntimeError: This event loop is already runningexception is raised.AioConnection.connectshould be a coroutine. Waiting for it's finishing should be caller's responsibility. Changing this function to a coroutine definitely breaks the current API. - Connection reset by peer should be handled.
- SSL should be supported. Current async code does not support ssl.
connection.Factoryshould be adapted to async code as well. - Circular reference between
AioConnectionand its underlyingprotocolshould be removed. - Async version of
botshould be added. - Debug usage of
printshould be removed.printis used 3 times inclient_aio.py. I assume the developer forgot to remove them. - Make the use of custom event loops easier. If one wants to use
AioSimpleIRCClientwith a custom event loop, subclassing bothAioReactorandAioSimpleIRCClientis required. It is supposed to be as simple as callingAioSimpleIRCClient(loop=loop) -
loopshould not be accepted as a positional argument. For example,AioReactor.__init__should be declared as
def __init__(self, on_connect=__do_nothing, on_disconnect=__do_nothing, *, loop=None)
-
asyncio.Lockshould be used overthreading.Rlock. - Async throttler
- Required version check
- Better tests.
- Dominant language
- Python
- Stars
- 422
- Forks
- 91
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jaraco/irc
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
area:cli area:security bug priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
docs pydanty:is-working
Difficulty 1/5 Under an hour Newbie friendliness 88/100
pydantic/pydantic-ai#13563 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
NCATSTranslator/Babel#1204 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
alltheplaces/alltheplaces#20570 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
sio2project/oioioi#981 · 1 reaction ·
Maintainers usually reply within 1 day