Skip to content
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

Implement prepare_for_start Producer callback #5

Open
utopos opened this issue Aug 12, 2024 · 1 comment
Open

Implement prepare_for_start Producer callback #5

utopos opened this issue Aug 12, 2024 · 1 comment

Comments

@utopos
Copy link

utopos commented Aug 12, 2024

Hello Team,

One more question to ask: would be a good idea for the buffer to be started withing the pipeline supervision tree?

Rationale: when buffer is not started or there's a mismatch between buffer names, it will bring the pipeline down.

Potential approach: implement the prepare_for_start callback that will add child spec of the buffer to the Broadway supervision tree and align the buffer names in the local Registry.

The Producer behaviour provides a callback for this:

The goal of this callback is to manipulate the general topology options, if necessary at all, and introduce any new child specs that will be started before the producers supervisor in Broadway's supervision tree. Broadway's supervision tree is a rest_for_one supervisor (see the documentation for Supervisor), which means that if the children returned from this callback crash they will bring down the rest of the pipeline before being restarted.

I already implented it in my local fork and works. I can contribute if you think this change makes sense.

@elliotekj
Copy link
Owner

Definitely something to consider. I'll have a play with this this week and update this ticket when I have more thoughts.

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

No branches or pull requests

2 participants