SDK for Stallion message broker
Project description
Stallion Python SDK
Client SDK for Stallion message broker
How to use?
Python install:
pip install stallion-python-sdk
Client
Create a client:
# importing Client module
from stallion import Client
# creating a client
# with given stallion server url
c = Client(url="st://localhost:9090")
Publish
# publish an object on a topic
c.Publish("book", {'author': "Amirhossein", 'name': "Stallion"})
Subscribe
# creating a handler
# any published object will be given to this handler as data
def handler(data):
print(f'{data['author']}: {data['name']})
# subscribe over a topic with given handler
c.Subscribe("book", handler)
Unsubscribe
# unsubscribe from a topic
c.Unsubscribe("book")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stallion-python-sdk-1.2.4.tar.gz.
File metadata
- Download URL: stallion-python-sdk-1.2.4.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b90d22b3e9d22eb87d5f550744d5b1be5cc5b1cd4891af29cef33c8e4bff70d1
|
|
| MD5 |
22588cb05433bc0b6b8f90a9e8fa8de2
|
|
| BLAKE2b-256 |
8d1fe8e593fb32123457b758bc962ecd90168807316e0c5b74c48eabfe810d83
|
File details
Details for the file stallion_python_sdk-1.2.4-py3-none-any.whl.
File metadata
- Download URL: stallion_python_sdk-1.2.4-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1260fc74d905b30aa89e580952b98e3ebcb4ad7033a0c39cb808d46489a5f1b1
|
|
| MD5 |
d74fc24a66b4a7e0c72fbf87d6fc1c39
|
|
| BLAKE2b-256 |
244d680659010b429ab40d0d8dfd6f90eb499dd4b3133ced56c591010b5c8dca
|