Class/Object

com.ccadllc.cedi.circuitbreaker

CircuitBreaker

Related Docs: object CircuitBreaker | package circuitbreaker

Permalink

sealed abstract class CircuitBreaker[F[_]] extends AnyRef

The library's main abstraction, representing protection of an effectful program. The API is relatively simple, consisting of one primary function, protect, which takes the program to protect and returns that an enhanced version of that program having the ability to fail fast without invoking the underlying service if conditions warrant, ensuring failure of the service it represents does not result in a cascade of failure. The CircuitBreaker has two secondary functions: 1.) currentStatistics, which provides the current statistics.Statistics for use by monitoring and dashboarding applications and; 2.) lastActivity which provides the java.time.Instant timestamp indicating the instant the CircuitBreaker was last active.

The CircuitBreaker is not generally directly instantiated; rather, a CircuitBreaker is requested from the CircuitBreakerRegistry via the CircuitBreakerRegistry#forFailure function which provides a variant that trips/opens given a configured percentage of protected program failures within a configured time period or via the CircuitBreakerRegistry#forFlowControl function which provides a variant that, in addition to the failure protected just described, also throttles requests when the average rate of requests over a configured time period is greater than the observed average rate of processing for the protected program.

F

- the type of effectful program.

Source
CircuitBreaker.scala
Linear Supertypes
AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CircuitBreaker
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def currentStatistics: F[Statistics]

    Permalink

    A description of the current statistics.Statistics for this CircuitBreaker.

    A description of the current statistics.Statistics for this CircuitBreaker.

    returns

    statistics - an effectful program that when run returns the current Statistics for this circuitbreaker.

  2. abstract def lastActivity: F[Instant]

    Permalink

    A description of the date/time that this CircuitBreaker was last active (that is, the last time its protect function was invoked).

    A description of the date/time that this CircuitBreaker was last active (that is, the last time its protect function was invoked).

    returns

    lastActivity - an effectful program that when run returns the java.time.Instant this circuitbreaker was last active.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from CircuitBreaker[F] to any2stringadd[CircuitBreaker[F]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (CircuitBreaker[F], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from CircuitBreaker[F] to ArrowAssoc[CircuitBreaker[F]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (CircuitBreaker[F]) ⇒ Boolean, msg: ⇒ Any): CircuitBreaker[F]

    Permalink
    Implicit information
    This member is added by an implicit conversion from CircuitBreaker[F] to Ensuring[CircuitBreaker[F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (CircuitBreaker[F]) ⇒ Boolean): CircuitBreaker[F]

    Permalink
    Implicit information
    This member is added by an implicit conversion from CircuitBreaker[F] to Ensuring[CircuitBreaker[F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): CircuitBreaker[F]

    Permalink
    Implicit information
    This member is added by an implicit conversion from CircuitBreaker[F] to Ensuring[CircuitBreaker[F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): CircuitBreaker[F]

    Permalink
    Implicit information
    This member is added by an implicit conversion from CircuitBreaker[F] to Ensuring[CircuitBreaker[F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from CircuitBreaker[F] to StringFormat[CircuitBreaker[F]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. val id: Identifier

    Permalink

    - the unique identifier for this circuit breaker.

    - the unique identifier for this circuit breaker. This is used to look up the CircuitBreaker instance from the registry (or, if not present, to create a new instance).

  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def protect[A](program: F[A]): F[A]

    Permalink

    Provides protection over the provided effectful program based on the configuration of this instance.

    Provides protection over the provided effectful program based on the configuration of this instance.

    A

    - the result type of the effectful program.

    program

    - the effectful program represented by F[A].

    returns

    program - an enhanced version of the passed-in program, wrapped in a protective layer that will fail fast when a threshold of failures have been observed for the underlying service and may also throttle requests when the observed inbound rate exceeds the processing rate.

  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  25. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. def [B](y: B): (CircuitBreaker[F], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from CircuitBreaker[F] to ArrowAssoc[CircuitBreaker[F]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from CircuitBreaker[F] to any2stringadd[CircuitBreaker[F]]

Inherited by implicit conversion StringFormat from CircuitBreaker[F] to StringFormat[CircuitBreaker[F]]

Inherited by implicit conversion Ensuring from CircuitBreaker[F] to Ensuring[CircuitBreaker[F]]

Inherited by implicit conversion ArrowAssoc from CircuitBreaker[F] to ArrowAssoc[CircuitBreaker[F]]

Ungrouped