Class 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

      All Methods Instance Methods Concrete Methods 
      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 Detail

      • 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 Detail

      • 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.