Re:Show HN: Pyper – Concurrent Python Made Simple
by Rickster35 on Wednesday January 15, 2025 @12:06PM
(#42713700)
According to the docs, | is syntactic sugar for the .pipe method.
pipeline = task(get_data, branch=True).pipe(
task(step1, workers=20)).pipe(
task(step2, workers=20)).pipe(
task(step3, workers=20, multiprocess=True))
That's probably chained method approach for those with this preference.
Re:Show HN: Pyper – Concurrent Python Made Simple
by me-vs-cat on Thursday January 16, 2025 @07:11PM
(#42732599)
This style looks pretty good to me:
pipeline = task(...)
pipeline |= task(...)
So does this style: steps = [task(...), task(...)]
pipeline = functools.reduce(operator.or_, steps)
But it appears you can just change "task" to "Task" and then: pipeline = pyper.Pipeline([Task(...), Task(...)])
you could reassign every line, but it would look nicer with chained functions.
edit:I would be tempted to do something like this: