AWS SQS broker for wiji. Wiji<https://github.com/komuw/wiji> is an asyncio distributed task processor/queue.
Project description
wijisqs
wiji is an asyncio distributed task processor/queue.
wijisqs on the other hand, is an AWS SQS broker for wiji
Installation
pip install wijisqs
Usage
1. As a library
import os
import wiji
import wijisqs
import asyncio
broker = wijisqs.SqsBroker(
aws_region_name="aws_region_name",
aws_access_key_id=os.environ.get("aws_access_key_id"),
aws_secret_access_key=os.environ.get("aws_secret_access_key"),
)
class AdderTask(wiji.task.Task):
the_broker = broker
queue_name = "AdderTaskQueue1"
async def run(self, a, b):
result = a + b
print("\nresult: {0}\n".format(result))
return result
# queue some tasks
myAdderTask = AdderTask()
myAdderTask.synchronous_delay(a=4, b=37)
myAdderTask.synchronous_delay(a=67, b=847)
# run the workers
worker = wiji.Worker(the_task=myAdderTask)
asyncio.run(worker.consume_tasks())
For extended documentation, see the wiji documentation
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
wijisqs-0.4.0b2.tar.gz
(12.8 kB
view hashes)
Built Distribution
wijisqs-0.4.0b2-py3-none-any.whl
(11.1 kB
view hashes)
Close
Hashes for wijisqs-0.4.0b2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30464694de3f7e4e70bb720106db9a87abcf7270d1594747b57a811e464b82ac |
|
MD5 | 90e30eab2162f5da56032917a50768c1 |
|
BLAKE2b-256 | 32e69dcc47a86c2543e6deaaf94ba543cccafd65a0ecfdf347e9660c4464e69e |