AWS SQS broker for wiji. Wiji<https://github.com/komuw/wiji> is an asyncio distributed task processor/queue.


Keywords
wijisqs, wiji
License
MIT
Install
pip install wijisqs==0.4.3

Documentation

wijisqs

Codacy Badge CircleCI codecov Code style: black

wiji is an asyncio distributed task processor/queue.

wijisqs on the other hand, is an AWS SQS broker for wiji

Contents:
Installation
Usage

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