/// <summary> /// The on publisher sending. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="args"> /// The eventArgs. /// </param> private void OnPublisherSending(object sender, PublisherSendingEventArgs args) { if (this.PublisherSending != null) { this.PublisherSending(sender, args); } }
/// <summary> /// The publisher send. /// </summary> /// <param name="publisher"> /// The publisher. /// </param> /// <param name="message"> /// The message. /// </param> /// <returns> /// The <see cref="IDisposable"/>. /// </returns> public IDisposable PublisherSend(IPublisher publisher, IMessage message) { return(GetActivityTracker( () => { var args = new PublisherSendingEventArgs { Message = message }; this.OnPublisherSending(publisher, args); }, t => { var args = new PublisherSentEventArgs { Elapsed = t, Message = message }; this.OnPublisherSent(publisher, args); })); }
/// <summary> /// The publisher send. /// </summary> /// <param name="publisher"> /// The publisher. /// </param> /// <param name="message"> /// The message. /// </param> /// <returns> /// The <see cref="IDisposable"/>. /// </returns> public IDisposable PublisherSend(IPublisher publisher, IMessage message) { return GetActivityTracker( () => { var args = new PublisherSendingEventArgs { Message = message }; this.OnPublisherSending(publisher, args); }, t => { var args = new PublisherSentEventArgs { Elapsed = t, Message = message }; this.OnPublisherSent(publisher, args); }); }