Async Python IPC using WebSockets
Project description
wsipc
Async Python IPC using WebSockets
Server Example (Simple Broker)
from asyncio import run
from wsipc import WSIPCServer
server = WSIPCServer(heartbeat=45)
run(server.start(block=True))
Client Example
from asyncio import create_task, run, sleep
from wsipc import WSIPCClient
client = WSIPCClient()
@client.listener()
async def on_message(message):
print(message)
@client.listener()
def sync_listener(message):
print(message)
async def main() -> None:
create_task(client.connect())
await client.connected.wait()
await client.send("Hello World!")
await sleep(1)
await client.close()
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
wsipc-0.0.3.tar.gz
(5.8 kB
view hashes)
Built Distribution
wsipc-0.0.3-py3-none-any.whl
(6.9 kB
view hashes)