Skip to main content

STOMP meets bottle.py

Project description

Shattered

STOMP meets bottle.py

Build Status

Getting Started

Installation

pip install shattered

Echo Server

app.py

import logging

from shattered import Shattered


logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

app = Shattered(host="rabbitmq")


@app.subscribe("/queue/echo")
def echo(headers, body, conn):
    logger.info("%s %s", headers, body)


@app.subscribe("/queue/echo")
def echo_fancy(headers, body, conn):
    logger.info("✨✨✨%s %s✨✨✨", headers, body)


app.run()

Running the Demo

Start up RabbitMQ using docker-compose up

In another shell, run docker-compose run shattered python examples/echo/echo.py

In another shell, run docker-compose run shattered python examples/echo/send.py

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

shattered-0.3.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

shattered-0.3.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file shattered-0.3.0.tar.gz.

File metadata

  • Download URL: shattered-0.3.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.7.6 Darwin/19.2.0

File hashes

Hashes for shattered-0.3.0.tar.gz
Algorithm Hash digest
SHA256 248dd80fe6805babeed7ccc909e993824f57cfd3a57b82ac3247b031d615ab48
MD5 5ec5c99f7b07f8b423a992e91642255b
BLAKE2b-256 70b382523332ee8f7e409b0a8337eb950912f33d61514fc42e3b5b884f250571

See more details on using hashes here.

File details

Details for the file shattered-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: shattered-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.7.6 Darwin/19.2.0

File hashes

Hashes for shattered-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d7630d4ff19ca669c0264ede945c9dc3f86a6bb5a1faca6b665518f1eaaa15a
MD5 479fd12bb9ceb8e3981ba96a94ac3ed5
BLAKE2b-256 c2b6add539cab0fbea57060a308a7c45a1d06e4c900f469ab6d763d7dfc14d8b

See more details on using hashes here.

Supported by

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