Skip to main content

taskwire

Progress reporting and awaitable dialogs for long-running operations, in Python and TypeScript.

A long-running job — an import, a report, a batch — needs to tell whoever started it what it is doing while it is doing it, and sometimes needs to ask them something before it can continue. taskwire is that conversation, and the four things it carries:

  • progress, with nested subtasks whose percentages compose correctly rather than overwriting each other, and commits coalesced so a tight loop cannot flood anything;
  • awaitable dialogs — the worker asks a question mid-job and blocks until the answer arrives, with the first answer winning across every tab that is looking;
  • cancellation, cooperative and sticky, which raises in the worker at its next progress call;
  • collectable results — the job parks a file or a value for later collection and exits, holding no worker while the record waits.

The one idea worth knowing

The store is the truth; a push is only an accelerator. Every state change is written before anything is sent anywhere, so a dropped, coalesced or suppressed push never changes what the next read returns. There is no event log, no sequence numbers and no replay: a client is entitled to current state, and asking for it is always enough.

One protocol, three implementations

The layering is the shape of the source tree:

             protocol            documents, envelopes, the six kinds, the state
                 │               machines, validation.  Knows of no transport.
     ┌───────────┼───────────┐
   local        REST         WS         three independent implementations of it
     │           │           │
  (none)   fastapi / asgi   muxws       one adapter each, to the world outside

The protocol is specified once and depends on nothing. Each implementation carries it over one medium and is written against the protocol layer alone, never against another implementation. Each adapter is the thin piece that binds an implementation to a particular framework, and is the only place that framework is imported.

Implementation Carries the protocol over Adapter Needs
local the process itself — no wire, no socket, no serialization none nothing
REST request/response polling; the baseline everywhere contrib.viewsets, contrib.fastapi, contrib.asgi nothing in core
WS one push per envelope down, the six calls up, lowest latency contrib.muxws muxws

Swapping one for another changes latency and nothing else — no feature, no state, no document. Both languages ship the protocol and the operating half, so a browser-only application runs operations rather than only watching them; the adapters, the Redis store and the Celery entry are Python's, and the polling client and the register are TypeScript's.

Install

pip install taskwire                 # core: no runtime dependencies at all
pip install "taskwire[redis]"        # cross-process store and backplane
pip install "taskwire[fastapi]"      # the REST adapter
pip install "taskwire[viewsets]"     # the REST API as a fastapi-viewsets viewset
pip install "taskwire[celery]"       # the worker entry point
pip install "taskwire[muxws]"        # the WebSocket transport
npm install taskwire

The demo

pip install -e ".[fastapi,viewsets,demo]" && npm install
python demo.py                       # then open http://127.0.0.1:5174

A night batch over one book: four back-office jobs that between them exercise progress, nested progress, awaitable dialogs, cancellation and collectable results. See demo/README.md.

Status

Pre-1.0 and under active construction. The wire format is versioned independently of the package (Envelope.v), so package semver says nothing about it.

Links

License

MIT. Copyright (c) 2026 Jure Erznožnik.

Download files

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

Source Distribution

taskwire-0.1.0.tar.gz (85.7 kB view details)

Uploaded Source

Built Distribution

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

taskwire-0.1.0-py3-none-any.whl (97.4 kB view details)

Uploaded Python 3

File details

Details for the file taskwire-0.1.0.tar.gz.

File metadata

  • Download URL: taskwire-0.1.0.tar.gz
  • Upload date:
  • Size: 85.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.2

File hashes

Hashes for taskwire-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9b80a95774eb048cd74c0448af3f667dc72be6cba7c4004ca65e4f16beb9384b
MD5 170457e7e1ea24088eaca91ed556cbc8
BLAKE2b-256 fccf6c92c8eba27ac2c8124950e3d1418c8f5951ef309593ac7fefa097d062e4

See more details on using hashes here.

File details

Details for the file taskwire-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: taskwire-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 97.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.2

File hashes

Hashes for taskwire-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7345cae51a2bd4bf30140d492b86d60b403c8bbacf5ff1336d3b7cd4c5b4b7c7
MD5 025e1795ceef8f0279c6da56a76f7553
BLAKE2b-256 6d339e2ecfca91ee5d8dcfd95a4ac005e788646335cc3dfa4a87dce018914a18

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

2 files

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