Exemplo n.º 1
0
 /// <summary>
 /// Set a new <see cref="IValueExceptionHandler{T}"/> for handling exceptions propagated out of the <see cref="IValueEventHandler{T}"/>
 /// </summary>
 /// <param name="exceptionHandler">exceptionHandler to replace the existing exceptionHandler.</param>
 public void SetExceptionHandler(IValueExceptionHandler <T> exceptionHandler)
 {
     _exceptionHandler = exceptionHandler ?? throw new ArgumentNullException(nameof(exceptionHandler));
 }
Exemplo n.º 2
0
 public void SwitchTo(IValueExceptionHandler <T> exceptionHandler) => _handler = exceptionHandler;
Exemplo n.º 3
0
 /// <summary>
 /// Specify an exception handler to be used for event handlers and worker pools created by this disruptor.
 /// The exception handler will be used by existing and future event handlers and worker pools created by this disruptor instance.
 /// </summary>
 /// <param name="exceptionHandler">the exception handler to use</param>
 public void SetDefaultExceptionHandler(IValueExceptionHandler <T> exceptionHandler)
 {
     CheckNotStarted();
     _exceptionHandler.SwitchTo(exceptionHandler);
 }
 /// <summary>
 /// Specify the <see cref="IValueExceptionHandler{T}"/> to use with the event handler.
 /// </summary>
 /// <param name="exceptionHandler">exceptionHandler the exception handler to use.</param>
 public void With(IValueExceptionHandler <T> exceptionHandler)
 {
     ((IValueEventProcessor <T>)_consumerRepository.GetEventProcessorFor(_eventHandler)).SetExceptionHandler(exceptionHandler);
 }