示例#1
0
        public Task PublishAsync(TEvent ev)
        {
            var stopwatch = Stopwatch.StartNew();

            return(_endpoint.PublishAsync(ev)
                   .ContinueWith(_ =>
            {
                stopwatch.Stop();
                _monitor.MessageSent(ev, stopwatch.Elapsed);
            }, TaskContinuationOptions.ExecuteSynchronously));
        }
 public Task PublishAsync(TEvent ev)
 {
     return(_endpoint.PublishAsync(ev));
 }