Esempio n. 1
0
        /// <summary>
        /// Dispatches the <see cref="IProducerStatusChange"/> message
        /// </summary>
        /// <param name="producerStatusChange">The <see cref="IProducerStatusChange"/> instance to be dispatched</param>
        void IGlobalEventDispatcher.DispatchProducerUp(IProducerStatusChange producerStatusChange)
        {
            Guard.Argument(producerStatusChange, nameof(producerStatusChange)).NotNull();

            var eventArgs = new ProducerStatusChangeEventArgs(producerStatusChange);

            Dispatch(ProducerUp, eventArgs, "ProducerUp", producerStatusChange.Producer.Id);
        }
Esempio n. 2
0
 /// <summary>
 /// Invoked when a product associated with the feed goes up
 /// </summary>
 /// <param name="sender">The instance raising the event</param>
 /// <param name="e">The event arguments</param>
 private void OnProducerUp(object sender, ProducerStatusChangeEventArgs e)
 {
     _log.Info($"Producer {e.GetProducerStatusChange().Producer} is up");
 }
Esempio n. 3
0
 /// <summary>
 /// Invoked when a product associated with the feed goes down
 /// </summary>
 /// <param name="sender">The instance raising the event</param>
 /// <param name="e">The event arguments</param>
 private void OnProducerDown(object sender, ProducerStatusChangeEventArgs e)
 {
     _log.Warn($"Producer {e.GetProducerStatusChange().Producer} is down");
 }
Esempio n. 4
0
 /// <summary>
 /// Marks the producer as up indicating the state of the SDK is in sync with the state of the feed
 /// </summary>
 /// <param name="sender">The <see cref="object"/> representation of the <see cref="IFeedRecoveryManager"/> instance raising the event</param>
 /// <param name="e">The <see cref="ProducerStatusChangeEventArgs"/> instance containing the event data</param>
 private void MarkProducerAsUp(object sender, ProducerStatusChangeEventArgs e)
 {
     ((IGlobalEventDispatcher)this).DispatchProducerUp(e.GetProducerStatusChange());
 }
Esempio n. 5
0
 /// <summary>
 /// Invoked when a product associated with the feed goes up
 /// </summary>
 /// <param name="sender">The instance raising the event</param>
 /// <param name="e">The event arguments</param>
 private void OnProducerUp(object sender, ProducerStatusChangeEventArgs e)
 {
     Console.WriteLine($"Producer {e.GetProducerStatusChange().Producer} is up");
 }
Esempio n. 6
0
        /// <summary>
        /// Dispatches the <see cref="IProducerStatusChange"/> message
        /// </summary>
        /// <param name="producerStatusChange">The <see cref="IProducerStatusChange"/> instance to be dispatched</param>
        void IGlobalEventDispatcher.DispatchProducerUp(IProducerStatusChange producerStatusChange)
        {
            var eventArgs = new ProducerStatusChangeEventArgs(producerStatusChange);

            Dispatch(ProducerUp, eventArgs, "ProducerUp");
        }