Skip to main content

pyzmq broker and client handlers with name based addressing

Project description

cobblr

This is a package for simple client-broker and client-client communications using the ZeroMQ package for python.

It is designed for M2M communications and easy passing of data between software modules. Each client program runs asynchronously in a single new background thread. Clients are addressed with a unique name and once registered with a broker can request new communications.

This package was built as part of the Digital Manufacturing on a Shoestring Project.

This library is in development.

Please check back soon!

API

from cobblr.cobblr import CobblrBroker
cb = CobblrBroker

Create and start a broker

from cobblr.cobblr import CobblrClient
cl = CobblrClient("cl_test")

Create and start a client named cl_test

cl.register()

Register client cl_test with the running broker

from cobblr.cobblr import CobblrClient
cr = CobblrClient("cr_test")
cr.register()

Create, start and register client cr_test

cl.request_connection("cr_test")

Request a connection to client cr_test from client cl_test

connection_list = cl.get_connected()

Populates connection_list with names of connected clients and broker. The broker is always named service.

cl.send_message("cr_test",["string_1", "string_2"])

Sends a message from client cl_test to client cr_test, consisting of two strings.

msg = ["no_msg"]
while msg == ["no_msg"]:
    msg = cr.get_messages()
print(msg)

Loop to read message inbox on client cr_test. Messages will be returned as a list, with each entry a list of [<message number>, <from address>, <message contents>].

The inbox is cleared on reading.

cr.end

Ends client cr_test.

API for pub-sub to be added soon

Features List

  • Client name registration at broker
  • Single IP space
  • Multiple IP and Network support
  • Request a connection to another named client
  • Request - Response messaging pattern between named clients
  • Publish - Subscribe messaging pattern
  • Simple state machine with task prioritisation
  • Asynchronous background operation
  • Smooth shutdown and restart
  • Heartbeat for network status and awareness
  • Backup broker
  • Network configuration save and load
  • Message encryption

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

cobblr-0.1.4.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cobblr-0.1.4-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file cobblr-0.1.4.tar.gz.

File metadata

  • Download URL: cobblr-0.1.4.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for cobblr-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9c66bdd3152b59a0b41295edc8a440dcfbe826e7a1ec903289dc47df32dbdc97
MD5 d19dfe2456f053a7920c776e24f3e169
BLAKE2b-256 e4cc2997cd4e58bf431650a9ae8a748f7ebb835fd3a9f1b3d7dbc4d6a746efba

See more details on using hashes here.

File details

Details for the file cobblr-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: cobblr-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for cobblr-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1dcd37a30fc3583a5fd2a74588f26603acf17cd94136a24a6aeaa885e067c939
MD5 18e28ae21f420f5f1a38159fd1b52a13
BLAKE2b-256 a8b7213da2642fe6ea315a00f2f13b7d95b0f0315ba0d3ebb290d618804a3a4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page