-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[10.x] Add pipe function to Process layer #46527
Conversation
@driesvints @taylorotwell |
@driesvints @taylorotwell this failed a test that's not related to my changes, do I need to do anything else here? |
@WendellAdriel I retriggered those |
Thank you so much!!! 😉 |
@taylorotwell is there anything else missing that I need to work on for this? |
Your usage example shows you passing an array to pipe, but the pipe methods expects a |
@taylorotwell oooh, I forgot to update the example, because at first it was like that, I'm going to update the example. |
I just updated the example in the PR description! |
Do we actually need a |
Another point for discussion: should we always throw on failure? Or, if there is a failure should we return the last failed process and let the user decide whether they want to |
That's a good point, I think we can just return the last failed process instead now that you mention it. |
…ion and added test case for failed pipe run
@taylorotwell I updated the code to return the last failed process, removed the |
Another thing - we allow you to add things to the pipe with a key (like pools), but we never pass that key to the output handler like we do with pooled proesses, this means if you pass as output callback to pipe's |
@taylorotwell thanks for the heads up, I missed that in the implementation 😅. I just updated the PR with a new commit for that. |
Thanks! |
I’m happy to help!!! 😉 💪 |
This is a follow-up of #46239 which had some issues with the branching.
This PR adds a new function
pipe
to the Process layer that receives an array of processes and runs them in sequence passing the output of the previous process as the input for the next one.The syntax will be like this:
Taking into consideration that the content of
test.txt
will be:This can be very handy when we need to chain processes that rely on the result of the previous one to run correctly.