I've seen examples of sending input to a node of the flow graph from C++ code outside of the flow graph by using:
Could you provide examples of how to receive output from a node of the flow graph by C++ code outside of the flow graph? I'm especially interested in getting output of async_node. I tried
cout << "got result of " << result << endl;
But, this never returns true. Plus, how does the output know when the graph is done, so that the while loop can terminate? Maybe this is a more general question of how to interface with the graph at the output of the graph.
Thank you for your response. I tried having async_node feed queue_node and used .try_get() to get output, which seems to work properly. The use case is where the graph is only a part of an overall system and is not the whole system itself. In this case, the overall system provides inputs to the graph and gets results from the graph.
Thank you once again,
When I use queue_node and get its output using .try_get() in my C++ code running outside of the flow graph, most. of the time .try_get() returns false, as it has nothing to return. Is there a more efficient way to get an output from queue_node than using .try_get() and polling until .try_get() returns a true? Is there an asynchronous way to accomplish this with a callback function that will be called when the queue_node has an element available? Or, is there a convenient way to accomplish push-pull method in my own C++ code to get output of queue_node?