Skip to main content

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

  1. Use the event loop from Python 3 for high performance
  2. No dependency
  3. 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=1234)
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.

Files for vertx-python-client, version 0.4.2
Filename, size File type Python version Upload date Hashes
Filename, size vertx_python_client-0.4.2-py3-none-any.whl (5.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size vertx-python-client-0.4.2.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page