Skip to main content

TaskIQ SQS Broker

Mostly generic SQS async broker for TaskIQ.

Expiration

If you set the sqs_expiry label to a unix timestamp, the message will be discarded if the worker receives it after that time.

import asyncio
from taskiq_sqs import SQSBroker

broker = SQSBroker("http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/my-queue")

@broker.task
async def add_one(value: int) -> int:
    return value + 1


async def main() -> None:
    # Never forget to call startup in the beginning.
    await broker.startup()
    # Send the task to the broker.
    task = await add_one.kiq(1)
    # Wait for the result. (result backend must be configured)
    result = await task.wait_result(timeout=2)
    print(f"Task execution took: {result.execution_time} seconds.")
    if not result.is_err:
        print(f"Returned value: {result.return_value}")
    else:
        print("Error found while executing task.")
    await broker.shutdown()

if __name__ == "__main__":
    asyncio.run(main())

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

taskiq_sqs-0.0.11.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

taskiq_sqs-0.0.11-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file taskiq_sqs-0.0.11.tar.gz.

File metadata

  • Download URL: taskiq_sqs-0.0.11.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for taskiq_sqs-0.0.11.tar.gz
Algorithm Hash digest
SHA256 687d35e3724634b628309ea5fc103ce0729146f5fece373a78eb4ac037cfd58e
MD5 0d29794fe615c2b955300a39238b0e95
BLAKE2b-256 3f09de185221b8dc6198896d9791e5b0a3b5301acdea9eb7dd995086642324f2

See more details on using hashes here.

File details

Details for the file taskiq_sqs-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: taskiq_sqs-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for taskiq_sqs-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 c81eeec76c12e686a5f28061ded18bbc53f52942c44f9a950b2e7f1d968b5767
MD5 c452acaf53dba4faa2825f65f26786e3
BLAKE2b-256 1e2a50bc4dd4b7f638c56fc001c54524378bba38d61c9ab6e69c1079f6a54ab5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.11 This release

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page