SocketSignal — Python client
Gravicode Studios, led by Kang Fadhil.
Bidirectional RPC over WebSockets, on asyncio.
pip install websockets
python example.py # needs a server: dotnet run --project ../../src/SocketSignal.Demo -- serve
import asyncio
from socketsignal import SocketSignalClient
async def main():
client = SocketSignalClient(call_timeout=10.0, auto_reconnect=True)
@client.on("serverHello")
async def hello(text):
return "python heard you"
await client.connect("ws://localhost:8080/ws/")
print(await client.call("sum", 5, 7)) # 12
await client.send("log", "no reply wanted")
await client.close()
asyncio.run(main())
| Register | client.on("name", handler) or @client.on("name"); sync or async |
| Call | await client.call("name", *args) |
| Fire and forget | await client.send("name", *args) |
| Errors | SignalInvocationError, SignalTimeoutError, SignalClosedError |
Full guide: docs/clients.md · Protocol: docs/protocol.md
Metadata
Release files for socketsignal 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| socketsignal-2.0.0.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| socketsignal-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.5 kB
Release files / socketsignal-2.0.0.tar.gz
| Download URL | socketsignal-2.0.0.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1dea5d090f60355136952e83c7a2f33f091f5774822457270b7df15385899fe7
|
|
BLAKE2b-256 checksum How to use checksums |
655e4d0857567e780edd237c772f745bb9aad5e15d2de27f55673912b651ab3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / socketsignal-2.0.0-py3-none-any.whl
| Download URL | socketsignal-2.0.0-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b7b416384399754b1c9720933336c1cbbfd33fbfcbe666e516f940ef1ffca82
|
|
BLAKE2b-256 checksum How to use checksums |
dca7d636137b6de4f4937f8905a0c56d032a33003f140a756e0d0d6f89882a54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|