private void AskSequential(IPerfReceiver receiver, Completion<TimeSpan> completion, Stopwatch sw, int messageCount) { if(messageCount == 0) { sw.Stop(); completion.Complete(sw.Elapsed); } receiver.Ask("foo").ContinueWith(t => AskSequential(receiver, completion, sw, messageCount - 1)); }
public Task<TimeSpan> TellSequential(int messageCount) { _tellParallel = false; _tellCount = 0; _tellExpected = messageCount; _tellTimer = Stopwatch.StartNew(); _tellCompletion = Context.GetCompletion<TimeSpan>(); _tellReceiver = Context.Create<IPerfReceiver>().Proxy; _tellReceiver.Tell(Guid.NewGuid(), "foo"); return _tellCompletion; }