/// <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); }
/// <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"); }
/// <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"); }
/// <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()); }
/// <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"); }
/// <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"); }