Skip to main content

STOMP meets bottle.py

Project description

Shattered

STOMP meets bottle.py

Build Status

Getting Started

Installation

pip install shattered

CLI

shattered run will run a Shattered app, using one of the following (in order):

  1. The --app flag.
  2. The SHATTERED_APP environment variable.
  3. app.py as the application module name.

Use shattered config to see the current configuration (same app resolution as run command).

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

Uploaded Source

Built Distribution

shattered-0.4.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shattered-0.4.0.tar.gz
  • Upload date:
  • Size: 3.2 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.4.0.tar.gz
Algorithm Hash digest
SHA256 de6d3d559da9784b7b12759c82942e92332e1e70ed65bc09dfb6a2c8b33c432a
MD5 b9329866d6df8472575c3896fe8dfbec
BLAKE2b-256 6bf95fb8feb414d3c02bf94bd290603c0a0c25d37e70789bc11cddab0610382c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shattered-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a69eb1b05768074d5dc10d682c0b30c1fd92cc1f399214c590be7608569ebaa3
MD5 75ade71301f36f3bcf7ddab898fc935e
BLAKE2b-256 b29c13797ae32d729eab39b8777cc17cf172de6834f33fd7c7bfc19f5002ba91

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