STOMP meets bottle.py
Project description
Shattered
STOMP meets bottle.py
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 hashes)
Built Distribution
Close
Hashes for shattered-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d7630d4ff19ca669c0264ede945c9dc3f86a6bb5a1faca6b665518f1eaaa15a |
|
MD5 | 479fd12bb9ceb8e3981ba96a94ac3ed5 |
|
BLAKE2b-256 | c2b6add539cab0fbea57060a308a7c45a1d06e4c900f469ab6d763d7dfc14d8b |