STOMP meets bottle.py
Project description
Shattered
STOMP meets bottle.py
Getting Started
Installation
pip install shattered
CLI
shattered run will run a Shattered app, using one of the following (in order):
- The
--appflag. - The
SHATTERED_APPenvironment variable. app.pyas 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shattered-0.5.0.tar.gz.
File metadata
- Download URL: shattered-0.5.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6 Linux/5.4.0-1032-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7f95937ade0ca24a1164dd09acbeb0a952297f77d95d61b61a4cb95bbd796f1
|
|
| MD5 |
4758d18aa879b561aa85a58d59a09441
|
|
| BLAKE2b-256 |
1fe97a421f031c0271a311a5eb91ae844187b24d5858be2c8220b091b71ecb3b
|
File details
Details for the file shattered-0.5.0-py3-none-any.whl.
File metadata
- Download URL: shattered-0.5.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6 Linux/5.4.0-1032-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a931e3e87dbd6674cd6e49a9079e1b1692e99663f9f1c37df93d96285d399dde
|
|
| MD5 |
d961c1025b4b4a31c00bd185fb0a6e39
|
|
| BLAKE2b-256 |
2bde1bd9e7aba1ea9a55e3df73433468f2fe5f6d0d69084b7d7643b5dd9b9667
|