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
--app
flag. - The
SHATTERED_APP
environment variable. 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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size shattered-0.4.0-py3-none-any.whl (3.6 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size shattered-0.4.0.tar.gz (3.2 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for shattered-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a69eb1b05768074d5dc10d682c0b30c1fd92cc1f399214c590be7608569ebaa3 |
|
MD5 | 75ade71301f36f3bcf7ddab898fc935e |
|
BLAKE2-256 | b29c13797ae32d729eab39b8777cc17cf172de6834f33fd7c7bfc19f5002ba91 |