Skip to main content

PubSubRT Python connector

Project description

PSRT Python connector

Python connector for PSRT

SDK Documentation: https://psrt-py.readthedocs.io/

Client usage example:

from psrt import Client
import time

def process_message(client, userdata, message):
    print(message.topic)
    print(message.payload)


client = Client(path='localhost:2873')
# client.tls = True
# client.tls_ca = '/opt/workstuff/psrt/certs/ca.crt'
# client.need_data_socket = False
client.on_message = process_message
client.connect()
client.subscribe('test')
client.subscribe_bulk(['test2', '#'])
client.unsubscribe('test')
client.unsubscribe_bulk(['test2', '#'])
client.subscribe('#')
for _ in range(3):
    client.publish('unit/tests/test1', 'hello')
    time.sleep(1)
client.bye()

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

psrt-0.0.19.tar.gz (9.9 kB view hashes)

Uploaded Source

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