Skip to content

Lightweight ROS-like pub-sub tool leveraging ØMQ

Notifications You must be signed in to change notification settings

yodahuang/zero-message

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zero Message

Documentation Status

Zero Message is a lightweight ROS-like pub-sub tool for Python 3.4+.

  • Provides a wrapper around ZeroMQ socket.
  • Communicate between any Python program using publisher-subscriber protocol

Installation

You need zeromq installed on your system. Refer to the official guide. For your convenience, here's some common ones:

# Debian-based
sudo apt-get install libzmq3-dev

# RHEL-based
sudo yum install libzmq3-devel

# Mac
brew install zmq

Then you can install this library

pip install zeromessage

Quick start

Refer to the /examples:

# listener.py
import asyncio
from zeromessage import EnvelopSocket

socket = EnvelopSocket.as_subscriber()

def doSomething(msg):
    print(msg)

subscribe_coroutine = socket.subscribe('test', doSomething)

asyncio.get_event_loop().run_until_complete(subscribe_coroutine())
# talker.py
import time
from zeromessage import EnvelopSocket

socket = EnvelopSocket.as_publisher()

while True:
    socket.publish('test', {
        'data': [1, 2, 3]
    })
    time.sleep(1)

Command Line tools

A rostopic like tool is provided.

zerotopic echo -- --help

API Document

The document is currently broken. In the mean time you can just take a look at the well-documented source code.

zero-message.readthedocs.io

About

Lightweight ROS-like pub-sub tool leveraging ØMQ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages