Class CircularEventConsumer<T>

java.lang.Object
io.github.resilience4j.consumer.CircularEventConsumer<T>
All Implemented Interfaces:
io.github.resilience4j.core.EventConsumer<T>

public class CircularEventConsumer<T>
extends java.lang.Object
implements io.github.resilience4j.core.EventConsumer<T>
A consumer which stores CircuitBreakerEvents in a circular buffer with a fixed capacity.
  • Constructor Summary

    Constructors 
    Constructor Description
    CircularEventConsumer​(int capacity)
    Creates an CircuitBreakerEventConsumer with the given (fixed) capacity
  • Method Summary

    Modifier and Type Method Description
    void consumeEvent​(T event)  
    io.vavr.collection.List<T> getBufferedEvents()
    Returns a list containing all of the buffered events.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CircularEventConsumer

      public CircularEventConsumer​(int capacity)
      Creates an CircuitBreakerEventConsumer with the given (fixed) capacity
      Parameters:
      capacity - the capacity of this CircuitBreakerEventConsumer
      Throws:
      java.lang.IllegalArgumentException - if capacity < 1
  • Method Details

    • consumeEvent

      public void consumeEvent​(T event)
      Specified by:
      consumeEvent in interface io.github.resilience4j.core.EventConsumer<T>
    • getBufferedEvents

      public io.vavr.collection.List<T> getBufferedEvents()
      Returns a list containing all of the buffered events.
      Returns:
      a list containing all of the buffered events.