Skip to content

feat: task result streaming with publish/stream/astream#35

Merged
pratyush618 merged 5 commits intomasterfrom
feat/result-streaming
Mar 22, 2026
Merged

feat: task result streaming with publish/stream/astream#35
pratyush618 merged 5 commits intomasterfrom
feat/result-streaming

Conversation

@pratyush618
Copy link
Copy Markdown
Collaborator

Summary

  • current_job.publish(data): stream partial results from inside tasks — stores as task log entries with level="result", reusing existing write_task_log infrastructure (zero Rust changes)
  • job.stream(timeout, poll_interval): blocking iterator that yields partial results as they arrive, stops on terminal job status
  • await job.astream(): async variant using asyncio.sleep
  • FastAPI SSE: GET /jobs/{id}/progress?include_results=true streams partial results alongside progress events

Test plan

  • uv run python -m pytest tests/python/ -v — 357 pass, 9 skipped
  • uv run ruff check py_src/ tests/ — clean
  • uv run mypy py_src/taskito/ tests/python/ — 0 errors
  • 5 new streaming tests: publish writes logs, stream yields results, stops on completion, async variant, non-dict data

- current_job.publish(data) writes partial results as task logs with
  level="result", reusing existing write_task_log infrastructure
- job.stream(timeout, poll_interval) yields partial results as a
  blocking iterator, stops on terminal job status
- job.astream() async variant using asyncio.sleep
- No Rust changes needed — built entirely on existing task_logs
Add ?include_results=true query param to GET /jobs/{id}/progress
to stream partial results alongside progress updates via SSE.
@pratyush618 pratyush618 merged commit 77f3205 into master Mar 22, 2026
10 checks passed
@pratyush618 pratyush618 deleted the feat/result-streaming branch March 31, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant