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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tesselite_pubsub-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 57cb59611fe5a605bf96be28f1fead4f9df8c5e8908a190c2be7912ddc1828f8
MD5 9b7beece251459b35511467f83988640
BLAKE2b-256 d382f6d7c0ffab9ac1784d6eb8dcb19df2dd291123e6dbafe0c59e4942c0b88b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tesselite_pubsub-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0d7199dca9e5dfa9e628752fc7f61bc69e62aba6cbce89b39a357e292b74876c
MD5 42b43a3fbad56d020406b7448ff3462e
BLAKE2b-256 0f1814e8703e95225c9e3e5a337a3a3f44c362106a40bae8ceff88b4bd25fddc

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