protected void ChildCallback(object cq, EventArgs arg) {
RpcResult child_r;
Channel child_q = (Channel)cq;
MapReduceInfo mri = (MapReduceInfo)child_q.State;
if (LogEnabled) {
ProtocolLog.Write(ProtocolLog.MapReduce,
String.Format("MapReduce: {0}, handling child result from: {1}.", _node.Address, mri.Sender.ToUri()));
}
if( child_q.Count == 0 ) {
child_r = new RpcResult(mri.Sender, new AdrException(-32000, "Child did not return"));
}
else {
child_r = (RpcResult)child_q.Dequeue();
}
Reduce(child_r);
}