File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class MyAsyncAction: public CoroActionNode
38
38
// Call setStatusRunningAndYield() to "pause".
39
39
// - Code to execute after the reply.
40
40
// - a simple way to handle halt().
41
-
41
+
42
42
NodeStatus tick() override
43
43
{
44
44
std::cout << name() <<": Started. Send Request to server." << std::endl;
@@ -53,10 +53,13 @@ class MyAsyncAction: public CoroActionNode
53
53
54
54
if( !reply_received )
55
55
{
56
- // set status to RUNNING and "pause/sleep"
56
+ // set status to RUNNING and "pause/sleep"
57
+ // If halt() is called, we will not resume execution
57
58
setStatusRunningAndYield ();
58
59
}
59
60
}
61
+
62
+ // this part of the code is never reached if halt() is invoked.
60
63
std::cout << name() <<": Done." << std::endl;
61
64
return NodeStatus::SUCCESS;
62
65
}
Original file line number Diff line number Diff line change @@ -38,10 +38,12 @@ class MyAsyncAction: public CoroActionNode
38
38
if ( !reply_received )
39
39
{
40
40
// set status to RUNNING and "pause/sleep"
41
+ // If halt() is called, we will not resume execution
41
42
setStatusRunningAndYield ();
42
43
}
43
44
}
44
45
46
+ // this part of the code is never reached if halt() is invoked.
45
47
std::cout << name () <<" : Done." << std::endl;
46
48
return NodeStatus::SUCCESS;
47
49
}
@@ -86,12 +88,10 @@ actionA: Started. Request service using async call
86
88
actionA: Waiting reply
87
89
actionA: Waiting reply
88
90
actionA: Waiting reply
89
- actionA: Waiting reply
90
91
actionA: Done
91
92
actionB: Started. Request service using async call
92
93
actionB: Waiting reply
93
94
actionB: Waiting reply
94
95
actionB: Waiting reply
95
- actionB: Waiting reply
96
96
actionB: Done
97
97
*/
You can’t perform that action at this time.
0 commit comments