An asynchronous Engine.IO client using the trio framework
Project description
Trio-Engine.IO
An asynchronous Engine.IO client using the trio
framework.
Only the revision 3 of the Engine.IO protocol is supported.
Requirements
- Python 3.9+
trio
httpcore
trio-websocket
Usage
import trio
from trio_engineio.trio_client import EngineIoClient, EngineIoConnectionError
def on_connect():
print(f"***** Connected")
def on_message(msg):
print(f"***** Received message: {msg}")
def on_disconnect():
print(f"***** Disconnected")
async def main():
eio = EngineIoClient(logger=False)
eio.on("connect", on_connect)
eio.on("message", on_message)
eio.on("disconnect", on_disconnect)
async with trio.open_nursery() as nursery:
try:
await eio.connect(nursery, "http://127.0.0.1:1234")
except EngineIoConnectionError:
return False
return True
trio.run(main)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
trio_engineio-0.2.0.tar.gz
(19.1 kB
view details)
Built Distribution
File details
Details for the file trio_engineio-0.2.0.tar.gz
.
File metadata
- Download URL: trio_engineio-0.2.0.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f80a9c6f948b973cf2567517a1437b55efaa8ce009774683c8340f2a4c2a9841 |
|
MD5 | 26701707f180acd0efc84c6be9b47a64 |
|
BLAKE2b-256 | 5df6e3d2783ee18589250ca259cb4b7c1a3e1d6af635fe0b9eca23e19e163aaf |
File details
Details for the file trio_engineio-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: trio_engineio-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df002001d39b4b277f1bff690e53870fd82dec0296c83bbb96e3b56f9bbc8aa7 |
|
MD5 | faf2153733ab64e4fe0e595ec7acdd7e |
|
BLAKE2b-256 | 398799982e9768d9c591bd17bc3648d3c7a1b8d4ca8724000e02e7f3e0bea487 |