Skip to main content

Wamp Client for Django Channels

Project description

Installation

$ pip install django-wamp-client

Add channels and wampclient to your INSTALLED_APPS:

INSTALLED_APPS = [
    'channels',
    'wampclient',
]

In your settings, configure your connection to the WAMP Router:

WAMP_CONNECTION = {
    'URL': "ws://127.0.0.1:9100/ws",
    'AUTHID': 'authid',
    'AUTHSECRET': 'secret',
    'REALM': "realname",
}

Configure your routing to include wampclient.routing:

channel_routing = [
    route("wamp.join", "testproject.consumers.wamp_join"),
    include('wampclient.routing'),
]

Start the channel workers:

$ ./manage.py runworker

Start the client that will connect to the WAMP Router:

$ ./manage.py wamp_client

Usage

from wampclient import publish, subscribe


def wamp_hello(greeting):
    publish('com.example.hello', "'sup?")


def wamp_join(message):
    # This consumer will be connected to the ``wamp.join`` channel
    subscribe('com.example.hello', wamp_hello)
    publish('com.example.hello', "Hi!", options={'exclude_me': False})

LICENSE

This software is released under the MIT License. See the LICENSE file.

Status

This project should be considered a proof of concept.

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

django-wamp-client-0.0.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

django_wamp_client-0.0.3-py2.py3-none-any.whl (5.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-wamp-client-0.0.3.tar.gz.

File metadata

File hashes

Hashes for django-wamp-client-0.0.3.tar.gz
Algorithm Hash digest
SHA256 aa79da30660b628a8d53266855e227be90a0ea2f71a30f4cfbf670b4447d08fc
MD5 4098445880b80592ecbd93e31581c4db
BLAKE2b-256 b9036234769fe0688ffe039ce793990a08aa95410d110648122f771d691ee120

See more details on using hashes here.

File details

Details for the file django_wamp_client-0.0.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_wamp_client-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 98c0304d1c48310c7c5f021ca868d5ab623c3210abe601f91b3fcf61160cc484
MD5 be60fa3e49e2b30cd177a7d63130db3c
BLAKE2b-256 95207e65e6c388d811ac8d6e4b3c718d02db7d90a47284c7aad58cb44228008a

See more details on using hashes here.

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