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
Close
Hashes for stallion-python-sdk-1.2.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b90d22b3e9d22eb87d5f550744d5b1be5cc5b1cd4891af29cef33c8e4bff70d1 |
|
MD5 | 22588cb05433bc0b6b8f90a9e8fa8de2 |
|
BLAKE2b-256 | 8d1fe8e593fb32123457b758bc962ecd90168807316e0c5b74c48eabfe810d83 |
Close
Hashes for stallion_python_sdk-1.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1260fc74d905b30aa89e580952b98e3ebcb4ad7033a0c39cb808d46489a5f1b1 |
|
MD5 | d74fc24a66b4a7e0c72fbf87d6fc1c39 |
|
BLAKE2b-256 | 244d680659010b429ab40d0d8dfd6f90eb499dd4b3133ced56c591010b5c8dca |