You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Define a pipeline with N steps. Pipelines can be normal pipelines or "farm pipelines" (in which some steps are parallel).
6
+
You can also define pipelines with mutable state.
7
+
8
+
fn pipelined() {
9
+
let pipeline = pipeline![
10
+
pipeline,
11
+
parallel!(LoadImage, 40),
12
+
parallel!(ApplyMoreSaturation, 2),
13
+
parallel!(ApplyEmboss, 2),
14
+
parallel!(ApplyGamma, 2),
15
+
parallel!(ApplySharpen, 2),
16
+
parallel!(ApplyGrayscale, 2),
17
+
parallel!(SaveImageAndGetResult, 40),
18
+
sequential!(PrintResult)];
19
+
20
+
let dir_entries = std::fs::read_dir("/Users/user/Desktop/imagens");
21
+
22
+
for entry in dir_entries.unwrap() {
23
+
let entry = entry.unwrap();
24
+
let path = entry.path();
25
+
26
+
if path.extension().is_none() { continue; }
27
+
28
+
println!("Posting {:?}", path.to_str().unwrap());
29
+
30
+
pipeline.post(path).unwrap();
31
+
32
+
}
33
+
34
+
pipeline.end_and_wait();
35
+
36
+
println!("Finished.");
37
+
}
38
+
39
+
40
+
# How to Cite our Work
41
+
42
+
Ricardo Pieper, Dalvan Griebler, and Luiz Gustavo Fernandes. 2019. **Structured Stream Parallelism for Rust.** In Proceedings of the XXIII Brazilian Symposium on Programming Languages (SBLP 2019). ACM, New York, NY, USA, 54-61. DOI: https://doi.org/10.1145/3355378.3355384
0 commit comments