A simple controller for message queue pipelines
Project description
<a href="https://codeclimate.com/github/luanguimaraesla/gabby/maintainability">
<img src="https://api.codeclimate.com/v1/badges/dc94cbf3854b542d3862/maintainability" />
</a>
<a href="https://travis-ci.org/luanguimaraesla/gabby">
<img src="https://travis-ci.org/luanguimaraesla/gabby.svg?branch=master" />
</a>
<a href="https://badge.fury.io/py/gabby">
<img src="https://badge.fury.io/py/gabby.svg" />
</a>
<a href="https://codecov.io/gh/codecov/example-python">
<img src="https://codecov.io/gh/luanguimaraesla/gabby/branch/master/graph/badge.svg" />
</a>
# Python Gabby
A simple controller for message queue pipelines using Mosquitto
## Installing
You can install the package through pip
```bash
pip install gabby
```
## Examples
Before run examples, please initialize the Mosquitto server.
#### Receiving messages
```python
from gabby.gabby import Gabby, Topic
from gabby.controller import Controller
class PrinterGabby(Gabby):
def transform(self, message):
print(f'ARRIVED! Data: {message.data}')
return []
if __name__ == "__main__":
controller = Controller()
topic_A = Topic('queue/a', 'i')
topic_B = Topic('queue/b', 'i')
printer_gabby = PrinterGabby([topic_A], [topic_B])
controller.add_gabby(printer_gabby)
controller.run()
```
#### Transmitting messages
```python
from gabby.gabby import Gabby, Topic
from gabby.message import Message
if __name__ == "__main__":
topic_A = Topic('queue/a', 'i')
topic_B = Topic('queue/b', 'i')
g = Gabby([topic_B], [topic_A])
data = (1,)
g.send(Message(data, g.output_topics))
```
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
gabby-0.0.5.tar.gz
(5.7 kB
view details)
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
gabby-0.0.5-py3-none-any.whl
(7.8 kB
view details)
File details
Details for the file gabby-0.0.5.tar.gz.
File metadata
- Download URL: gabby-0.0.5.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ce34933342e3c351ee6b635d4ffe3849262747e105680b93a680e1c3525ee6a
|
|
| MD5 |
f16619c0e6467ca8498b496099a34f4f
|
|
| BLAKE2b-256 |
ab01a6f7db39182e23e50ee47ca4694fba58a0404968a55904316b4bfb7b8272
|
File details
Details for the file gabby-0.0.5-py3-none-any.whl.
File metadata
- Download URL: gabby-0.0.5-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7c9c3a7c7f5ef4c7169387cb479f1266e22b714d0dd8d08254b714550aa1d33
|
|
| MD5 |
c525c5411e798f70f935649d93a0d481
|
|
| BLAKE2b-256 |
99894311b3a3dcc2c910f09ebb5714ba9ff550c8c1fe3d507ceafbe03776cc5f
|