Async, typed Python runtime client for FlowQueue (publish + consume)
Project description
flowqueue
Async, typed Python runtime client for FlowQueue — a cloud-native message processing platform. The SDK does two things: publish messages and consume deliveries. Everything else (creating queues/consumers, API keys, replay, dead-letter recovery, metrics) lives in the FlowQueue UI (or the HTTP API directly).
pip install flowqueue
Requires Python 3.9+. Ships with type hints (py.typed) — editors autocomplete
response shapes (MessageOut, DeliveryOut).
Quickstart
Create the queue and consumer in the FlowQueue UI, then use their ids here:
import asyncio
from flowqueue import AsyncFlowQueueClient, AsyncFlowQueueConsumer
QUEUE_ID = "<queue_id>"
CONSUMER_ID = "<consumer_id>"
async def main():
async with AsyncFlowQueueClient("https://flowqueue.example.com", "fq_your_api_key") as client:
# Publish (optionally scheduled)
await client.publish(QUEUE_ID, {"order_id": 42}, idempotency_key="order-42")
await client.publish(QUEUE_ID, {"order_id": 43}, delay_seconds=30) # deliver in 30s
# Consume one delivery
consumer = AsyncFlowQueueConsumer(client, CONSUMER_ID)
d = await consumer.poll()
if d:
print(d["payload"])
await consumer.complete(d["id"], remark="done")
asyncio.run(main())
Run a worker loop
The handler may be sync or async. Return → the delivery is completed; raise → it is failed (retry / DLQ per queue config).
async def handle(delivery):
await process(delivery["payload"])
async def main():
async with AsyncFlowQueueClient(url, key) as client:
await AsyncFlowQueueConsumer(client, CONSUMER_ID).run(handle, poll_interval=2.0)
Scheduling
from datetime import datetime, timedelta, timezone
await client.publish(qid, {"ping": 1}, delay_seconds=30)
await client.publish(qid, {"ping": 1}, deliver_at=datetime.now(timezone.utc) + timedelta(hours=1))
Errors
Non-2xx responses raise flowqueue.ApiError(status, code, message).
from flowqueue import ApiError
try:
await client.publish(qid, {"x": 1})
except ApiError as e:
print(e.status, e.code, e.message)
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flowqueue-0.2.0.tar.gz.
File metadata
- Download URL: flowqueue-0.2.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66b849f2c0a8d4aac4fe7bd0bc9ffccbc4dcc252eb2365831357e1f11aea0507
|
|
| MD5 |
c1f9eb31c89d82a56b2e2f34b0d4110f
|
|
| BLAKE2b-256 |
4534e2cc524a0c3dfec799c6a5542304dda5a7db2ac9d99f53e6829ac5279a30
|
Provenance
The following attestation bundles were made for flowqueue-0.2.0.tar.gz:
Publisher:
publish.yml on Skill-College/flowqueue
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flowqueue-0.2.0.tar.gz -
Subject digest:
66b849f2c0a8d4aac4fe7bd0bc9ffccbc4dcc252eb2365831357e1f11aea0507 - Sigstore transparency entry: 1765995565
- Sigstore integration time:
-
Permalink:
Skill-College/flowqueue@ef34209922e4ea954f6159b19fd021a982fb6961 -
Branch / Tag:
refs/tags/sdk-v-1.1.0 - Owner: https://github.com/Skill-College
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ef34209922e4ea954f6159b19fd021a982fb6961 -
Trigger Event:
release
-
Statement type:
File details
Details for the file flowqueue-0.2.0-py3-none-any.whl.
File metadata
- Download URL: flowqueue-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95517ce78e5aa79ded245e4ba8efa38316ef4bd4c539e0344281cc5453db9999
|
|
| MD5 |
d06f7e5af5c607268babc54463a7c1c2
|
|
| BLAKE2b-256 |
72acc6a3b40709a98aef0bc710f6dcdc16c0f4e5d83da9182aeb71e029c8648c
|
Provenance
The following attestation bundles were made for flowqueue-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on Skill-College/flowqueue
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flowqueue-0.2.0-py3-none-any.whl -
Subject digest:
95517ce78e5aa79ded245e4ba8efa38316ef4bd4c539e0344281cc5453db9999 - Sigstore transparency entry: 1765995901
- Sigstore integration time:
-
Permalink:
Skill-College/flowqueue@ef34209922e4ea954f6159b19fd021a982fb6961 -
Branch / Tag:
refs/tags/sdk-v-1.1.0 - Owner: https://github.com/Skill-College
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ef34209922e4ea954f6159b19fd021a982fb6961 -
Trigger Event:
release
-
Statement type: