Easykiwi
Easykiwi is a Python Framework for developing Queue Messaging Application in a declarative approach, it depends on the kiwipy python library, in fact it turns this library into a container friendly framework.
Requirements
- Python 3.6+
- RabbitMQ
Defining Application
from easykiwi import Kiwi
app = Kiwi()
Adding RPCs
@app.add_rpc
def fib(comm, num):
if num == 0:
return 0
if num == 1:
return 1
return fib(comm, num - 1) + fib(comm, num - 2)
Adding Tasks
@app.add_task
def callback(_comm, task):
print((" [x] Received %r" % task))
time.sleep(task.count(b'.'))
print(" [x] Done")
Adding Broadcast
@app.add_broadcast
def subscriber(_comm, body, sender, subject, _corr_id):
print("Broadcast received:")
print("sender:\t{}\nsubject:{}\nbody:\t{}\n".format(
sender, subject, body))
Running Application
app.run(remote='127.0.0.1')
Running Application from Console Script
Yon can save your app in a app.py file or save it in an KIWI_APP environment variable, and then from the terminal execute the following.
kiwi run --remote 127.0.0.1
This command is a more container friendly approach to run this messaging service.
Release files for Easykiwi 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Easykiwi-1.3.win-amd64.zip | 52.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Easykiwi-1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.0 kB
Release files / Easykiwi-1.3.win-amd64.zip
| Download URL | Easykiwi-1.3.win-amd64.zip |
|---|---|
| Size | 52.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffb3fbc2ce0bc54704e7ab97f9cb7d2eee71c67618510c0a2efb1e7c0d1c386e
|
|
BLAKE2b-256 checksum How to use checksums |
f11739742a1d698ce2e6b3aa579a7de92b0db581013f443fd3fb789de286075f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|
Release files / Easykiwi-1.3-py3-none-any.whl
| Download URL | Easykiwi-1.3-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d2a6130191f9f7357bddc96dabaa6e6bdab6b935857aabc1d29f78dc91063ab
|
|
BLAKE2b-256 checksum How to use checksums |
a1f496572d5b26ce05f65fd2564b555c6a622448269d932a58f0854435f74cae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|