Skip to main content

Nameko extension with a Cometd client implementing Bayeux protocol

Project description

https://travis-ci.org/Overseas-Student-Living/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.

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.

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

nameko-bayeux-client-0.0.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

nameko_bayeux_client-0.0.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file nameko-bayeux-client-0.0.1.tar.gz.

File metadata

File hashes

Hashes for nameko-bayeux-client-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9b433ce1f81e6bbda8a4f2bcbe8b7b4a82e43f7413b7205a6c0854a727ba5a32
MD5 5011d78228d24e98241668befa5fab7d
BLAKE2b-256 7bc439edaab90d8b4bd76aa84df1e6eeb3db3b19973bf588530e6cb42d3f3675

See more details on using hashes here.

File details

Details for the file nameko_bayeux_client-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nameko_bayeux_client-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 811580e25c839e3f6fbc2dbde79b6a2aa334f71ac52d0bab8211a65aa4547188
MD5 e64d36d551af264feddf7d3a47d82c2b
BLAKE2b-256 4c4781fa452c4d5393f2afb0e88d0cba1e60770d73ba657e55a77c2fb28138f7

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