Skip to main content

general sugarcoat for all pubsub flavors.

Project description

tesselite-pubsub

general sugarcoat for all pubsub flavors.

pubsub

Publish Subscribe is a pretty simple mechanism understandable by any human.

For example, it is the ruling mechanism of all Social Networks.

But, yet very complex to code in Python given the variety of backends logic (redis, rabbitMQ, kafka, GCP PubSub, Azure Event Hubs..)

The goal of this library is to streamline the coding of Pubsub in two simple calls:


usage

low level usage

from tesselite.pubsub import pubsubFactory

def callback(message): # callback function inputs serialized message 
    print(f"received this: {message}")
    
# consume loop
with pubsubFactory(broker="gcp-pubsub")(topic="tesselite-pubsub", log_name="consumer") as pubsub:
    pubsub.consume(callback=callback, deadLetter=None, subscription="tesselite")

high level usage

from tesselite.samples import consume # importing consume sample


def callback(message): # callback function inputs serialized message 
    print(f"received this: {message}")

if __name__ == '__main__':
    consume(broker='gcp-pubsub', callback=callback) # single-lined consume loop (default topic: tesselite-pubsub

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

tesselite_pubsub-0.1.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

tesselite_pubsub-0.1.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file tesselite_pubsub-0.1.2.tar.gz.

File metadata

  • Download URL: tesselite_pubsub-0.1.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for tesselite_pubsub-0.1.2.tar.gz
Algorithm Hash digest
SHA256 22c021c9ebedaca4340b9e39373052425c488f7b50ef9b6cdca43969d864bb40
MD5 60665166bbe1bdb9ed66a957e3e49593
BLAKE2b-256 dbb85f48b841d4d9ed4974f8a9e083183ede86bf800db68a98ee470cf1ef3d80

See more details on using hashes here.

File details

Details for the file tesselite_pubsub-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tesselite_pubsub-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for tesselite_pubsub-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 223e93a4c448d54708d8095e1d3ff69958081db987b46e82a8d1fc066049ff93
MD5 edad0a8641df3cb7534b85ade0faf8b7
BLAKE2b-256 97668a31694c445ba7ba7c78aff9076242e69a52dfba8b640b719b02170e48ca

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