Skip to main content

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

Project description

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

Installation

pip install wijisqs

Usage

1. As a library

import os
import wiji
import wijisqs
import asyncio

class AdderTask(wiji.task.Task):
    async def run(self, a, b):
        result = a + b
        print("\nresult: {0}\n".format(result))
        return result

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"),
            )
myAdderTask = AdderTask(the_broker=broker, queue_name="AdderTaskQueue1")

# queue some tasks
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


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.1.1.tar.gz (10.3 kB view hashes)

Uploaded Source

Built Distribution

wijisqs-0.1.1-py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page