Nameko extension with a Cometd client implementing Bayeux protocol
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nameko-bayeux-client-0.0.1.tar.gz
.
File metadata
- Download URL: nameko-bayeux-client-0.0.1.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b433ce1f81e6bbda8a4f2bcbe8b7b4a82e43f7413b7205a6c0854a727ba5a32 |
|
MD5 | 5011d78228d24e98241668befa5fab7d |
|
BLAKE2b-256 | 7bc439edaab90d8b4bd76aa84df1e6eeb3db3b19973bf588530e6cb42d3f3675 |
File details
Details for the file nameko_bayeux_client-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: nameko_bayeux_client-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 811580e25c839e3f6fbc2dbde79b6a2aa334f71ac52d0bab8211a65aa4547188 |
|
MD5 | e64d36d551af264feddf7d3a47d82c2b |
|
BLAKE2b-256 | 4c4781fa452c4d5393f2afb0e88d0cba1e60770d73ba657e55a77c2fb28138f7 |