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.2.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

shattered-0.2.0-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for shattered-0.2.0.tar.gz
Algorithm Hash digest
SHA256 21ba1856c4254371a1e6fc991b6b6cb69c34114eda6b315082d629aedadab30a
MD5 9d6cf6c5b600ab689b1dc614aebbc171
BLAKE2b-256 e88c033a9e6c06bea67fb7c36d2bfa6fbb4aff99a256702c1e0655690f1242e2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for shattered-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7fe809898528e97b420ec3669163fb297dbda415d3d54bcbc4de8a35661548eb
MD5 5ce8700e520b3c863e8f73121b2b8e7c
BLAKE2b-256 1416a91bab5c0a820cb5cd0264b130940c815b731e32a66cf7fd4b2a6c04f0bb

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