Metadata-Version: 2.4
Name: aiofastnet
Version: 0.0.2
Summary: Fast transport/protocol networking for asyncio
Author-email: Taras Kozlov <tarasko.projects@gmail.com>
Project-URL: Homepage, https://github.com/tarasko/aiofastnet
Project-URL: Repository, https://github.com/tarasko/aiofastnet
Project-URL: Issues, https://github.com/tarasko/aiofastnet/issues
Project-URL: Documentation, https://aiofastnet.readthedocs.io/en/latest
Keywords: asyncio
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: System :: Networking
Requires-Python: >=3.9
Description-Content-Type: text/x-rst

aiofastnet
==========

``aiofastnet`` provides highly optimized ``asyncio`` loop
``create_connection`` and ``create_server`` implementations.
It is a drop-in replacement for the standard ``asyncio`` functions.

Internally, it reimplements parts of CPython's transport/SSL stack with Cython
and C to reduce overhead on hot I/O paths.

Basic Usage
-----------

Use it similarly to stdlib ``asyncio`` APIs by passing the running loop:

.. code-block:: python

   import asyncio
   from aiofastnet import create_connection, create_server

   class Echo(asyncio.Protocol):
       def connection_made(self, transport):
           self.transport = transport

       def data_received(self, data):
           self.transport.write(data)

   async def main():
       loop = asyncio.get_running_loop()

       server = await create_server(loop, Echo, host="127.0.0.1", port=9000)
       transport, protocol = await create_connection(
           loop, Echo, host="127.0.0.1", port=9000
       )

       transport.close()
       server.close()
       await server.wait_closed()

   asyncio.run(main())

Status
------

This project is focused on performance-sensitive ``asyncio`` networking and is
implemented specifically for CPython.
