TCP client module for vertx TCP eventbus bridge
Project description
TCP-eventbus-client-Python
Introduction
This is a TCP eventbus implementation for python clients. The protocol is quite simple. for more information visit !https://github.com/jaymine/TCP-eventbus-client-Python
4bytes int32 message length (big endian encoding)
json string
built-in keys
type: (String, required) One of “send”, “publish”, “register”, “unregister”.
headers: (Object, optional) Headers with JSON format. Value of string type is supported.
body: (Object, optional) Message content in JSON format.
address: (String, required) Destination address
replyAddress: (String, optional) Address for replying.
example
class Client():
#Handler
- def Handler(self,message):
- if message != None:
print(message[‘body’][‘result’],’4’);
eb=Eventbus.Eventbus(Client(),’localhost’, 7000)
#jsonObject -body
body={‘msg’:’add 4 to 0’,}
#DeliveryOption
do=DeliveryOption.DeliveryOption(); do.addHeader(‘type’,’text’) do.addHeader(‘size’,’small’) do.addReplyAddress(‘add’) do.setTimeInterval(5)
#register handler
eb.registerHandler(‘add’,Client.Handler);
#send
eb.send(‘add’,body,do)
#close after 5 seconds
eb.closeConnection(5)
samples
Simple example, TimeKeeper
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
File details
Details for the file vertx-eventbus-2.0.0.zip.
File metadata
- Download URL: vertx-eventbus-2.0.0.zip
- Upload date:
- Size: 25.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b9fa18fff4a4a6a5cc86f7c5066a803599cebc3f794c9e0bdbd7a1374a3c270
|
|
| MD5 |
8753f4d7940aad7ece53339a5a98e8b9
|
|
| BLAKE2b-256 |
4267945c74801023a566fde88df39178fd2cd6441ae3ec124df5ec71139409b7
|