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

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


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.3.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

wijisqs-0.4.3-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file wijisqs-0.4.3.tar.gz.

File metadata

  • Download URL: wijisqs-0.4.3.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for wijisqs-0.4.3.tar.gz
Algorithm Hash digest
SHA256 ee67b8278e81a19e6f4871331df336429dc07b46158648caae8f84cc95a4d29b
MD5 e38b520315244af9d467f974d0e0d68c
BLAKE2b-256 d1f2a3460c724d1f30630ca969904323d1d04f1b2429f72a1aa00efb3614146a

See more details on using hashes here.

File details

Details for the file wijisqs-0.4.3-py3-none-any.whl.

File metadata

  • Download URL: wijisqs-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for wijisqs-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4e2aff6f33af58b99aaec7aa0de43115bd3df9fa613ae14d12d499fbeb42b9d0
MD5 da2b2a71dcade1f72af7d8d93fae3210
BLAKE2b-256 285d75ffacc0a2c54935300eaa6f8d3fbf2f92a6b6e36375021d9791eba0cff9

See more details on using hashes here.

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