protected void TreeHandler(object o, EventArgs eargs) {
Channel result = (Channel)o;
Channel q = (Channel)result.State;
try {
RpcResult r = (RpcResult)result.Dequeue();
var mris = new List<MapReduceInfo>();
foreach(IDictionary d in (IList)r.Result) {
var uri = (string)d["sender"];
var sender = SenderFactory.CreateInstance(_node, uri);
var args = new MapReduceArgs((IDictionary)d["args"]);
mris.Add(new MapReduceInfo(sender, args));
}
q.Enqueue(mris.ToArray());
}
catch(Exception x) {
//Some kind of problem:
q.Enqueue(x);
}
}
public override void Reduce(Channel q, object reduce_arg, object current_result, RpcResult child_rpc) {