Skip to main content

SDK for Stallion message broker

Project description

Stallion Python SDK


go version version
version version version

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

stallion-python-sdk-1.2.4.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

stallion_python_sdk-1.2.4-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page