Pika plugin module for Bottle microframework
Project description
Bottle-Pika is a plugin that integrates Pika (AMQP) with your Bottle application. It automatically connects to AMQP at the beginning of a request, passes the channel to the route callback and closes the connection and channel afterwards.
To automatically detect routes that need a channel, the plugin searches for route callbacks that require a mq keyword argument (configurable) and skips routes that do not. This removes any overhead for routes that don’t need a message queue.
- This plugin was originally based on the bottle-mysql plugin found at:
Usage Example:
import bottle
import bottle_pika
import pika
app = bottle.Bottle()
pika_plugin = bottle_pika.Plugin(pika.URLParameters('amqp://localhost/'))
app.install(pika_plugin)
@app.route('/hello')
def hello(mq):
mq.basic_publish(...)
return HTTPResponse(status=200)
- See pika documentation on channels for more information:
http://pika.readthedocs.org/en/latest/modules/channel.html#pika.channel.Channel
Project details
Release history Release notifications | RSS feed
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 bottle_pika-0.1.0.tar.gz.
File metadata
- Download URL: bottle_pika-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d55b23be8dc93dfdd843fbcff88cc6e059503b4a28a470e261b0a8f4dec3534
|
|
| MD5 |
7b01c498d5b12ab7dbd152e8c2f66995
|
|
| BLAKE2b-256 |
d85e324e1f1eb41c1efc78a6f9a1421f86ee2cb62f00c1e09809c8cd9dbac172
|
File details
Details for the file bottle_pika-0.1.0-py2.7.egg.
File metadata
- Download URL: bottle_pika-0.1.0-py2.7.egg
- Upload date:
- Size: 5.0 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc2e5cf1375fadd33a532e1eb0f302a677f01baecdcdab38b74291316d412828
|
|
| MD5 |
541278286d7b820656515bd2b88a6f97
|
|
| BLAKE2b-256 |
eb3a314a71de9b28f0d13cdc7429a1e13fafd61c024d14192ff6f93bf689ec71
|