RWTIOUResult Callbacks
You can define a callback that is invoked when an
RWTIOUResult becomes redeemable. The callback enables your application to perform other work instead of waiting for the result and without polling the
RWTIOUResult for its completion status. The following example extends the previous example:
// Get the IOU that will eventually contain the result
RWTIOUResult<RWFtpReply> iou = ftp.cd("pub");
// Add a callback to the IOUResult that will call our member
// function when the redeemable is ready.
iou.addCallback(rwIOUMakeCallbackM(myClass, *this,
&myClass::getResult,
RWFtpReply));
void
myClass::getResult(RWTIOUResult<RWFtpReply> iou)
{
// Redeem the IOU and get the result
RWFtpReply r = iou;
}