- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've seen examples of sending input to a node of the flow graph from C++ code outside of the flow graph by using:
node.try_put()
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
output_type result;
while( node.try_get(result))
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.
Thanks,
-Victor
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Victor,
Currently, only nodes that support output buffering can be used in the way that you want (doc - try_get() section) and async_node is not on the list. You may connect async_node with some buffering node to store the results there and then retrieve them with try_get().
- Nikita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you please provide a use case for your request? What do you want to achieve? Maybe we could find a better solution.
Nikita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Nikita,
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,
-Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Nikita,
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?
Thank you,
-Victor
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page