-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
There are two kinds of operation: adapter1 operations (like map, flat_map, filter, chain) and reducer operations (like sum, max, collect, fold).
Adding a reducer operation
- introduce a type that implements
ParallelSink, probably in a new file in amadeus-core/src/par_sink (don't forget to addmod new_file;to amadeus-core/src/par_sink.rs).- amadeus-core/src/par_sink/count.rs and amadeus-core/src/par_sink/histogram.rs are good starting points for how to implement the
FolderSynctrait. - The
FolderSynctrait and thefolder_par_sinkmacro are a convenience to minimise boilerplate implementingParallelSinkfor operations which can be implemented as a synchronous fold operation, which is most of them.
- amadeus-core/src/par_sink/count.rs and amadeus-core/src/par_sink/histogram.rs are good starting points for how to implement the
- add the user-facing methods to create this type in amadeus-core/src/par_pipe.rs and amadeus-core/src/par_stream.rs
- (ideally, I know some are missing!) add a test in tests, probably in a new file with the same name as 1.
- Make clippy and rustfmt happy
cargo clippy --all-targetsandcargo fmt --all - Open a PR!
Adding an adapter operation
- introduce a type that implements
ParallelStreamandParallelPipe, probably in a new file in amadeus-core/src/par_stream (don't forget to addmod new_file;to amadeus-core/src/par_stream.rs).- amadeus-core/src/par_stream/filter.rs and amadeus-core/src/par_stream/flat_map.rs are good starting points.
- add the user-facing methods to create this type in amadeus-core/src/par_pipe.rs and amadeus-core/src/par_stream.rs
- (ideally, I know some are missing!) add a test in tests, probably in a new file with the same name as 1.
- Make clippy and rustfmt happy
cargo clippy --all-targetsandcargo fmt --all - Open a PR!
- I'm sure there's a better name than "adapter operations", please comment if you have one!
Metadata
Metadata
Assignees
Labels
No labels