Skip to main content

ADSocket transport library

Project description

Adsocket transport

Install

pip install adsocket-transport

Usage

Transport initialization and sending message is very simple

from adsocket_transport import ADSocketTransport

adsocket = ADSocketTransport(
        driver='redis',
        host='redis://localhost:6379',
        db=1
    )

adsocket.send_data(data={'obj': 'user', 'obj_id': 4}, channels={'name': 'global', 'id': 'global'})

in case of async transport

from adsocket_transport import ADSocketAsyncTransport

adsocket = ADSocketAsyncTransport(
        driver='redis',
        host='redis://localhost:6379',
        db=1
    )
await adsocket.send_data(data={'obj': 'user', 'obj_id': 4}, channels={'name': 'global', 'id': 'global'})

Alternatively you can create message manually

from adsocket_transport import Message, ADSocketAsyncTransport

adsocket = ADSocketAsyncTransport(
        driver='redis',
        host='redis://localhost:6379',
        db=1
    )

message = Message(type='publish', data={'obj': 'user', 'obj_id': 4}, channel='global', channel_id='global')
await adsocket.send(message)

For more see adsocket-transport.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for adsocket-transport, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size adsocket_transport-0.1.0-py3-none-any.whl (7.1 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size adsocket-transport-0.1.0.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page