Implementing the One-Way Method Asynchronously
This section discusses implementing a one-way method asynchronously. Even though a one-way method expects no response, you may wish to implement it asynchronously, allowing you to make another call on the proxy without waiting for the transport to return.
This discussion assumes background knowledge on one-way methods and how they work. For information, see
The One Way Pattern.Now let’s look at the implementation of the one-way invoke() method in AsyncClient.cpp in the <installdir>\examples\Async directory.
void invoke_oneWayMethod(AsyncProxy& proxy) //1
{
std::string input_in("Hello World");
rwsf::CallInfo info;
std::cout << "Invoking oneWayMethod" << std::endl; //2
rwsf::AsyncHandle handle = //3
proxy.oneWayMethodStart(info,input_in);
proxy.oneWayMethodEnd(handle); //4
std::cout << "Finished executing the one way method"
<< std::endl; //5
}