How to use callback results in asynchronous model C++
<p>I have a C++ API which has a certain defined functions and it's related callbacks.
All these functions are asynchronous in nature. </p>

<p>Now, using this API I want to construct an asynchronous system which sends
multiple request to the server for collecting different data items and then use
these data item for further use.</p>

<p>For example: </p>

<pre><code>void functionA()
    {
      requestDataForA(); //asynchronous request to the server
     //async wait for the callback 
      processDataForA(); 
    }

void functionB()
    {
      requestDataForB(); //asynchronous request to the server
     //async wait for the callback 
      processDataForB(); 
    }
void functionC()
    {
      requestDataForC(); //asynchronous request to the server
     //async wait for the callback
      processDataForC(); 
    }
</code></pre>

<p>Now my question is that when the callback gives the data item, how to use it for subsequent processing. It cannot be done in callback as callback doesn't know who will use the data.</p>

<p>Thanks<br>
Shiv</p>
