Skip to content

Pipeline streaming #304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 2, 2025
Merged

Conversation

stellasia
Copy link
Contributor

@stellasia stellasia commented Mar 13, 2025

Description

Add a Pipeline.stream method that yields events about pipeline progress leveraging the callback mechanism already in place:

  • Make pipeline.callbacks a list
  • Implement a new Pipeline.stream method with the following logic:
    • Create a new callback that put events in an asyncio.Queue and append it to the callbcks list
    • Create asyncion task to run pipeline in background
    • Loop until the run task is done and the event queue is empty:
      • check run task status (done or pending)
      • yield event from queue if any

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update
  • Project configuration change

Complexity

Complexity: High

How Has This Been Tested?

  • Unit tests
  • E2E tests
  • Manual tests

Checklist

The following requirements should have been met (depending on the changes in the branch):

  • Documentation has been updated
  • Unit tests have been updated
  • E2E tests have been updated
  • Examples have been updated
  • New files have copyright header
  • CLA (https://neo4j.com/developer/cla/) has been signed
  • CHANGELOG.md updated if appropriate

@stellasia stellasia force-pushed the feature/actual-pipeline-streaming branch 2 times, most recently from 04f94e9 to dadead2 Compare March 18, 2025 13:24
@stellasia stellasia changed the title Feature/actual pipeline streaming Pipeline streaming Mar 20, 2025
@stellasia stellasia force-pushed the feature/actual-pipeline-streaming branch from dadead2 to f03efae Compare March 20, 2025 10:53
@stellasia stellasia marked this pull request as ready for review March 20, 2025 11:17
@stellasia stellasia requested a review from a team as a code owner March 20, 2025 11:17
@stellasia stellasia force-pushed the feature/actual-pipeline-streaming branch from a9f6b38 to a8bda1d Compare March 28, 2025 12:31
@stellasia stellasia force-pushed the feature/actual-pipeline-streaming branch from a8bda1d to 2645692 Compare April 1, 2025 11:29
Copy link
Member

@oskarhane oskarhane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good change! 🍶

@stellasia stellasia merged commit 42ab19a into neo4j:main Apr 2, 2025
7 checks passed
@stellasia stellasia deleted the feature/actual-pipeline-streaming branch April 15, 2025 11:25
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.

4 participants