Skip to content
Nameko extension with a Cometd client implementing Bayeux protocol supporting server to client event delivery via long-polling HTTP transport.
Python Makefile
Branch: master
Clone or download
Latest commit 0807dff Apr 26, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
nameko_bayeux_client
tests
.gitignore
.travis.yml More explicit CI jobs definition Apr 26, 2019
LICENCE
Makefile
README.rst
setup.py
tox.ini

README.rst

https://travis-ci.org/nameko/nameko-bayeux-client.svg?branch=master

Nameko Cometd Bayeux Client

Nameko extension with a Cometd client implementing Bayeux protocol supporting server to client event delivery via long-polling HTTP transport.

The library is used by Nameko Salesforce which has been connected to a fairly busy production Salesforce account for over a year and proved robust.

Installation

Install from PyPI with pip:

pip install nameko-bayeux-client

Usage

Add Bayeux client configuration to your Nameko config file:

# config.yaml

BAYEUX:
    VERSION: 1.0
    MINIMUM_VERSION: 1.0
    SERVER_URI: http://example.com/cometd

Decorate entrypoint in your service class:

# service.py

from nameko_bayeux_client import subscribe

class Service:

    name = 'some-service'

    @subscribe('/some/topic')
    def handle_event(self, data):
        # this entrypoint is fired on incoming events
        # of '/some/topic' channel
        print(data)

Run your service, providing the config file:

$ nameko run service --config config.yaml

On start-up, the extension connects to Cometd server, subscribes and starts listening to channels defined by entrypoints.

You can’t perform that action at this time.