A websocket library for curio + trio
Project description
asyncwebsockets
=======
asyncwebsockets is a `curio`_ + `trio`_ compatible library for connecting and serving websockets.
Installation
------------
To install the latest stable version::
$ pip install asyncwebsockets
To install the latest development version::
$ pip install git+https://github.com/Fuyukai/asyncwebsockets.git#egg=asyncwebsockets
Basic Usage
-----------
.. code-block:: python3
import multio
import asyncwebsockets
async def test():
async with asyncwebsockets.open_websocket("wss://echo.websocket.org") as ws:
await ws.send("test")
evt = await ws.next_event()
print(type(evt), getattr(evt, 'data', None))
multio.init("curio")
multio.run(test)
.. _curio: https://curio.readthedocs.io/en/latest/
.. _trio: https://trio.readthedocs.io/en/latest/
=======
asyncwebsockets is a `curio`_ + `trio`_ compatible library for connecting and serving websockets.
Installation
------------
To install the latest stable version::
$ pip install asyncwebsockets
To install the latest development version::
$ pip install git+https://github.com/Fuyukai/asyncwebsockets.git#egg=asyncwebsockets
Basic Usage
-----------
.. code-block:: python3
import multio
import asyncwebsockets
async def test():
async with asyncwebsockets.open_websocket("wss://echo.websocket.org") as ws:
await ws.send("test")
evt = await ws.next_event()
print(type(evt), getattr(evt, 'data', None))
multio.init("curio")
multio.run(test)
.. _curio: https://curio.readthedocs.io/en/latest/
.. _trio: https://trio.readthedocs.io/en/latest/
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
asyncwebsockets-0.3.0.tar.gz
(9.2 kB
view hashes)
Built Distributions
Close
Hashes for asyncwebsockets-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7e260fadaa6d3fbffc7cdeb43b1fe22a6303c5496332c31e1c0a366a9f94e19 |
|
MD5 | b53598c96e8f9b775ad6d7ca87df4c10 |
|
BLAKE2b-256 | d7a1bb962f59375bf36061aa3d81827e7b1567dc47cf54a825bf0c604140e224 |