@@ -192,7 +192,7 @@ These tasks are spawned by a parent task and are grouped together to a *subflow*
192192The example below demonstrates how to create a subflow
193193that spawns three tasks during its execution.
194194
195- <img align =" right " src =" image/subflow_join.png " width =" 30 %" >
195+ <img align =" right " src =" image/subflow_join.png " width =" 35 %" >
196196
197197``` cpp
198198// create three regular tasks
@@ -225,17 +225,18 @@ its parent node.
225225You can disable this feature by calling ` subflow.detach() ` .
226226Detaching the above subflow will result in the following execution flow.
227227
228- <img align =" right " src =" image/subflow_detach.png " width =" 40 %" >
228+ <img align =" right " src =" image/subflow_detach.png " width =" 35 %" >
229229
230230``` cpp
231- // detach a subflow graph
232- [] (auto & subflow) {
231+ // spawn a subflow from TaskB
232+ [] (tf::SubflowBuilder & subflow) {
233233 ...
234234 B1.precede(B3);
235235 B2.precede(B3);
236236
237- // detach from B
237+ // detach from TaskB
238238 subflow.detach();
239+
239240}).name(" TaskB" );
240241```
241242
@@ -277,13 +278,13 @@ the execution of a subflow and so on.
277278<img align =" right " src =" image/nested_subflow.png " width =" 25% " >
278279
279280``` cpp
280- tf::Task A = tf.emplace([] (tf::SubflowBuilder& sbf){
281+ tf::Task A = tf.emplace([] (tf::SubflowBuilder& sbf) {
281282 std::cout << "A spawns A1 & subflow A2\n";
282283 tf::Task A1 = sbf.emplace([ ] () {
283284 std::cout << "subtask A1\n";
284285 }).name("A1");
285286
286- tf::Task A2 = sbf.emplace([ ] (tf::SubflowBuilder& sbf2){
287+ tf::Task A2 = sbf.emplace([ ] (tf::SubflowBuilder& sbf2) {
287288 std::cout << "A2 spawns A2_1 & A2_2\n";
288289 tf::Task A2_1 = sbf2.emplace([ ] () {
289290 std::cout << "subtask A2_1\n";
@@ -293,6 +294,7 @@ tf::Task A = tf.emplace([] (tf::SubflowBuilder& sbf){
293294 }).name("A2_2");
294295 A2_1.precede(A2_2);
295296 }).name("A2");
297+
296298 A1.precede(A2);
297299}).name(" A" );
298300```
@@ -413,7 +415,7 @@ digraph Taskflow {
413415}
414416```
415417
416- ## Dump the Dispatched Graphs
418+ ## Dump a Dispatched Graph
417419
418420When you have dynamic tasks (subflows),
419421you cannot simply use the ` dump ` method because it displays only the static portion.
0 commit comments