Skip to content

Commit

Permalink
Merge pull request #144 from MattBroach/asyncio
Browse files Browse the repository at this point in the history
Asyncio
  • Loading branch information
jaraco committed May 21, 2018
2 parents e8f6ed2 + 48b35d6 commit 1eb5a3b
Show file tree
Hide file tree
Showing 9 changed files with 1,036 additions and 520 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__pycache__
.cache
.eggs
.pytest_cache/
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
====

* #140: Methods now use 'connection' and 'event' for parameter names.
# #135 via #144: Added AsyncIO implementation.

16.2.1
======
Expand Down
25 changes: 22 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ The main features of the IRC client framework are:
connection object.
* Messages from an IRC server triggers events, which can be caught
by event handlers.
* Reading from and writing to IRC server sockets is normally done
by an internal ``select()`` loop, but the ``select()`` may be done
by an external main loop.
* Multiple opations for reading from and writing to an IRC server:
you can use sockets in an internal ``select()`` loop OR use
python3's asyncio event loop
* Functions can be registered to execute at specified times by the
event-loop.
* Decodes CTCP tagging correctly (hopefully); I haven't seen any
Expand All @@ -76,6 +76,7 @@ Current limitations:
* Data is not written asynchronously to the server (and DCC peers),
i.e. the ``write()`` may block if the TCP buffers are stuffed.
* Like most projects, documentation is lacking ...
* DCC is not currently implemented in the asyncio-based versin

Unfortunately, this library isn't as well-documented as I would like
it to be. I think the best way to get started is to read and
Expand All @@ -90,6 +91,13 @@ The following modules might be of interest:
docstrings to get a grip of what it does. Use it at your own risk
and read the source, Luke!

* ``irc.client_aio``

All the functionality of the above library, but utilizing
Python 3's native asyncio library for the core event loop.
Interface/API is otherwise functionally identical to the classes
in ``irc.client``

* ``irc.bot``

An IRC bot implementation.
Expand All @@ -116,6 +124,17 @@ Example scripts in the scripts directory:

The same as above, but using the ``SimpleIRCClient`` class.

* ``aio_irccat``

Same as above, but uses the asyncio-based event loop in
``AioReactor`` instead of the ``select()`` based ``Reactor``.


* ``aio_irccat2``

Same as above, but using the ``AioSimpleIRCClient`` class


* ``servermap``

Another simple example. ``servermap`` connects to an IRC server,
Expand Down
10 changes: 10 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import sys
import fnmatch
import os

collect_ignore = ["setup.py"]

if sys.version_info < (3, 5):
for root, dirnames, filenames in os.walk('.'):
for filename in fnmatch.filter(filenames, '*aio.py'):
collect_ignore.append(os.path.join(root, filename))

0 comments on commit 1eb5a3b

Please sign in to comment.