Protocols support 🚀 #23
Labels
architecture 🏚
Solution design thinking and talking is required for issue
core 💎
Issue belongs to the core development context
enhancement
New feature or request
p-high
High priority issue
Description
Since the inception of the asyncio library in Python 3.5, the Python network world has changed, and a lot of "scalability" emerged from that.
As Netius was created before the arrival of
asyncio
, the tech approach to network diverged. Although both strategies represent nonblocking asyncio event-loop-based solutions overall, they have different approaches and abstractions for server and client implementation.The objective of this issue is to merge (via compatibility layer) both approaches, making it possible for the following scenarios:
Meaning full bi-directional compatibility between Netius's way of working and the
asyncio
one.Implementation
Architecture
Service
that spawns multiple connections (that should be converted into transports)Change ideas
Command-based client
We must rethink what a command-based client (e.g., SMTP, IMAP, etc.) is, as their session is currently very hard-coded. It must be much more similar to a command-based server, kind of like a bot-based server (more similar to the FTP server). And their state machine should be more flexible.
Migration strategy
This is the overall idea of how to migrate a client.
Principles
auto_close
andauto_pause
no longer make senseTesting
To test that both strategies are working, one can use the ASYNCIO=1 env variable to run in the asyncio event loop. The COMPAT=1 mode will ensure that Netius's services and clients run the compatibility layer, meaning that they should be able to run with the asyncio API behavior expectations, calling the proper protocol callbacks, etc.
Reference
Transports and protocols (callback-based API)
aiohttp server
The text was updated successfully, but these errors were encountered: