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.4.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.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tesselite_pubsub-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 76cad83bee91b063f1f8de9800541cdbf547bd42ebb3177b603964ad19b15fd2
MD5 37380733135b67dedb6e8cb1c478639f
BLAKE2b-256 57641fe313a2a2a6a2b7e233939b61c207f516cc9547b5b94bbf6e314be67d51

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tesselite_pubsub-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 12daa40e7806ff9299f879186cde48365fa292a68b3bc29b0f3ab97760ce66e3
MD5 2ec704c787671f7c7e0d2d50e12a4264
BLAKE2b-256 edf497eec954eb30183c8beef52e8c4e90343d4f2d77656e40c8ec4a196808cb

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