An asynchronous TCP eventbus Python client
Project description
vertx-python-client
An asynchronous TCP eventbus Python client other than the thread-based official client
Feature
- Use the event loop from Python 3 for high performance
- Provide a command line interface
Install
pip install vertx-python-client
Usage
Use as a standard Python library
from vertx import EventBus, Payload
eb = EventBus(host='localhost', port=1011)
eb.connect()
eb.add_listen_func(address="api.versions", action=lambda x: print(x))
# Send the JSON binary
reg = Payload(type="register", address="api.versions")
eb.send(reg)
pub = Payload(type="publish", address="api.versions.get", replyAddress="api.versions")
eb.send(pub)
# Quit the connection
eb.disconnect()
Instead use from the command line interface
python -m vertx localhost:1234
> {"type": "register", "address": "api.versions"}
> {"type": "publish", "address": "api.versions.get", "replyAddress": "api.versions"}
> exit
Test
pytest --log-cli-level=DEBUG tests
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
Built Distribution
Close
Hashes for vertx-python-client-0.3.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a49e73e46b931d977d05b7b882bf1e9a9c8b6367512b6c08ac1b09eea2e6536b |
|
MD5 | 5a27f64e0bdc8f6b8046cfefd24bb9a7 |
|
BLAKE2b-256 | b8739c2d0ec97dd9074e57807e6b9c2bfff39c2b88302dbb538f862a6870bea8 |
Close
Hashes for vertx_python_client-0.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be7dc41725c40131e2a126329812688ebe260fef79836fb31ee53902c68a9be8 |
|
MD5 | 29d52596f90b483e241c51c1af906168 |
|
BLAKE2b-256 | 9c7b272f58e5b641f2ae3df4a5cdf4b11c3054e3d791695dbc5f20ea66d214d6 |