Skip to content

AsyncPipeline.stream POC#11258

Draft
anakin87 wants to merge 12 commits into
mainfrom
streaming-poc
Draft

AsyncPipeline.stream POC#11258
anakin87 wants to merge 12 commits into
mainfrom
streaming-poc

Conversation

@anakin87
Copy link
Copy Markdown
Member

@anakin87 anakin87 commented May 5, 2026

Related Issues

Proposed Changes:

  • expose an AsyncPipeline.stream method that returns a PipelineStreamHandle
    • async iterator enabling async for chunk in handle
    • exposes a result field to get the final result

Choices and limitations:

  • at pipeline level: this unlocks most features without changing much code
  • async-only: the use case is async; trying to make it work with sync could create more problems than benefits
  • to be able to return the final result, I am not using a generator but an async iterator (PipelineStreamHandle). This currently makes the integration with Hayhooks not exactly ergonomic, but we can work to improve it

Does not contain breaking changes but it's thought for Haystack 3.

How did you test it?

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
haystack-docs Ready Ready Preview, Comment May 14, 2026 2:04pm

Request Review

@anakin87 anakin87 added the ignore-for-release-notes PRs with this flag won't be included in the release notes. label May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack/core/pipeline
  async_pipeline.py 760
Project Total  

This report was generated by python-coverage-comment-action

@anakin87 anakin87 changed the title Streaming poc AsyncPipeline.stream POC May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release-notes PRs with this flag won't be included in the release notes. topic:core topic:tests type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant