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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tesselite_pubsub-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 8dde628be7e66417b892e777534c582aa8cd91378383efe6be226d38d2a1abed
MD5 4e8b8bcc0f5c7da6c1fcbffeabf07b08
BLAKE2b-256 e3b442a0b7b8340fb0b88b382a7402216496134b6e1124fdaed413a08942e685

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tesselite_pubsub-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 92994114c2ffd55fc1dbadfa0449219ac82077c66544d1a0a5dd3fdb69088ee1
MD5 b29e7618c7135c7df1b93e98668b918d
BLAKE2b-256 3080f0d4d3baa58f81e03587e9b008067df76e115a2405c5cc67c283e3ab1d7b

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