-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: initial working version of echo server with asyncio loop
Using `COMPAT=1 ASYNCIO=1 python echo.py`.
- Loading branch information
Showing
2 changed files
with
105 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Compatibility with asyncio | ||
|
||
As part of the effort to make Netius more compatible with asyncio, the following | ||
changes have been made: | ||
|
||
- The `netius` module provides a `COMPAT` mode that allows it to be used to allows Netius protocols | ||
to be used with asyncio. This mode is enabled by setting the `COMPAT` environment variable to `True`. | ||
|
||
## Testing | ||
|
||
To run the echo server Protocol implementation using netius run: | ||
|
||
```bash | ||
PYTHONPATH=. python3 netius/servers/echo.py | ||
``` | ||
|
||
To use the compat version meaning that an asyncio-like interface will be used underneath the hoods use: | ||
|
||
```bash | ||
COMPAT=1 PYTHONPATH=. python3 netius/servers/echo.py | ||
``` | ||
|
||
To use the compat version and make use of the native asyncio event loop use the following: | ||
|
||
```bash | ||
COMPAT=1 ASYNCIO=1 PYTHONPATH=. python3 netius/servers/echo.py | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters