https://github.com/andreimarcu/aamnotifs
Simple notifications implementation with RabbitMQ using pika.
https://github.com/andreimarcu/aamnotifs
Last synced: 11 months ago
JSON representation
Simple notifications implementation with RabbitMQ using pika.
- Host: GitHub
- URL: https://github.com/andreimarcu/aamnotifs
- Owner: andreimarcu
- License: mit
- Created: 2013-07-24T23:15:18.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2015-02-11T02:26:56.000Z (over 11 years ago)
- Last Synced: 2024-11-15T17:42:34.288Z (over 1 year ago)
- Language: Python
- Size: 222 KB
- Stars: 18
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
aamnotifs
=========
Simple notifications implementation with RabbitMQ using pika.
Requirements
------------
* Python 2.6+
* pika
Usage
-----
Best illustrated in the provided examples but this is the basic idea:
Connect to the RabbitMQ server:
```python
n = aamnotifs.Notifs("amqps://user:password@domain.tld:5673/%2F")
```
Send a message:
```python
n.send("test_channel_one", "Notification title", "Notification content")
n.send("test_channel_two", "Notification title", "Notification content")
```
Listen for messages:
```python
n.receive("test_channel_one", callback_function)
# OR n.receive(["test_channel_one", "test_channel_two"], callback_function)
# or even n.receive(["#"], callback_function) # wildcard matches all channels
```
Author
-------
Andrei Marcu
http://andreim.net/