protected void Callback(object o, EventArgs ea)
{
Channel q = o as Channel;
try {
RpcResult res = (RpcResult) q.Dequeue();
int result = (int) res.Result;
if(result != 0) {
throw new Exception(res.Result.ToString());
}
long end_time = DateTime.UtcNow.Ticks / TimeSpan.TicksPerMillisecond;
long latency = end_time - _start_time;
LatenciesInMs.Add((int) latency);
} catch(Exception e) {
Console.WriteLine(e);
}
if(--_waiting_on == 0) {
Finished();
}
}