Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

starfish-outbox

A durable, per-identity offline write-queue — the client-side complement to the server-side queuing extension.

Generic over the queued item: you own what an item is, supply its dedup id, and a send that performs the real write. The queue handles persistence (write-through to a LocalCache), dedup-by-id, single-shot claim (no double-send), attempt counting with auto-retry-then-fail, crash-safe recovery of stuck sending entries, and subscriptions. drain_outbox is connectivity-agnostic — you trigger it on whatever reconnect signal you have.

Install

pip install starfish-outbox

Usage

from starfish_outbox import OutboxQueue, drain_outbox

queue: OutboxQueue = OutboxQueue(local_cache)  # local_cache: async get_item / set_item / remove_item
await queue.hydrate(f"outbox.{user_id}")

# Enqueue a write while offline (the id is yours to thread into the eventual write):
await queue.enqueue(write_id, {"path": path, "body": body})

# Drain on reconnect:
async def send(entry):
    await client.push(entry.item["path"], entry.item["body"], base_hash_for(entry.item["path"]))

await drain_outbox(queue, send, max_attempts=5)

Mutating methods (enqueue / claim / remove / retry / …) are async because each writes through to the cache; get / pending / subscribe are synchronous. JSON-compatible on disk with the TypeScript @drakkar.software/starfish-outbox.

Metadata

Release files for starfish-outbox 3.0.0a72

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for starfish-outbox 3.0.0a72
File Size Uploaded
starfish_outbox-3.0.0a72.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for starfish-outbox 3.0.0a72
File Interpreter ABI Platform
starfish_outbox-3.0.0a72-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / starfish_outbox-3.0.0a72.tar.gz

Download URL starfish_outbox-3.0.0a72.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e308025284d01912e84e2b6e541a7e2df32d14e9f26b16c36b89a3c6e513dd2b
BLAKE2b-256 checksum
How to use checksums
bd37e5f4e69322a440aab35c6c166d4fe38bd278de390b716e949495ad9b1fa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / starfish_outbox-3.0.0a72-py3-none-any.whl

Download URL starfish_outbox-3.0.0a72-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bd62f3dd0cfec16cca8d78d747b491059ebf18a959d02fb886829116eacc63a
BLAKE2b-256 checksum
How to use checksums
a5c3facc06b2e7ffb91a144cb302ce6d66a61e3a619909f4330958bfb1afc78b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page