Skip to content

Commit 91f5bf5

Browse files
Fixes for TwoStateFanoutExample
Wait until the entire plan has run to print the tracing results.
1 parent a6728b4 commit 91f5bf5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

example/com/linkedin/parseq/example/composite/TwoStageFanoutExample.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ protected void doRunExample(final Engine engine) throws Exception
5555
public void run()
5656
{
5757
System.out.println(fanout.get());
58-
printTracingResults(fanout);
5958
}
6059
});
6160

62-
engine.run(seq(fanout, printResults));
61+
final Task<?> plan = seq(fanout, printResults);
62+
engine.run(plan);
6363

64-
printResults.await();
64+
plan.await();
65+
printTracingResults(plan);
6566
}
6667

6768
private static class FanoutTask extends BaseTask<String>
@@ -81,7 +82,8 @@ public Promise<String> run(final Context ctx)
8182
final Task<String> twoStage =
8283
seq(par(fetchAndLog("http://www.bing.com"),
8384
fetchAndLog("http://www.yahoo.com")),
84-
fetchAndLog("http://www.google.com"),
85+
par(fetchAndLog("http://www.google.com"),
86+
fetchAndLog("https://duckduckgo.com/")),
8587
buildResult());
8688
ctx.run(twoStage);
8789
return twoStage;

0 commit comments

Comments
 (0)