Object/Class

com.ccadllc.cedi.circuitbreaker

CircuitBreaker

Related Docs: class CircuitBreaker | package circuitbreaker

Permalink

object CircuitBreaker

The companion object for a CircuitBreaker instance. The smart constructors for creation of failure and flow control CircuitBreaker instances live here, as do common data types used by CircuitBreaker instances.

Source
CircuitBreaker.scala
Linear Supertypes
AnyRef, Any
Content Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CircuitBreaker
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class CircuitBreakerEvent extends Product with Serializable

    Permalink

    An Algebraic Data Type (ADT) representing the events which may be published to the fs2.Stream by the CircuitBreaker whenever there is a state change (a CircuitBreaker opening or closing, or a CircuitBreaker throttling a request, or increasing/decreasing the rate at which a request is throttled).

  2. sealed abstract class CircuitBreakerException extends RuntimeException with Product with Serializable

    Permalink

    An Algebraic Data Type (ADT) representing the exceptions which may be returned by a protected program to indicate that the CircuitBreaker itself is failing the request prior to underlying program invocation.

  3. case class ClosedEvent(id: Identifier, stats: FailureStatistics) extends CircuitBreakerEvent with Product with Serializable

    Permalink

    This event is published whenever a CircuitBreaker is "closed" (testing having determined the underlying program is capable of normal invocation).

    This event is published whenever a CircuitBreaker is "closed" (testing having determined the underlying program is capable of normal invocation).

    id

    - identifies the CircuitBreaker which triggered this event.

    stats

    - the statistics.FailureStatistics which provide details on the current state of the CircuitBreaker.

  4. class FailureEvaluator extends AnyRef

    Permalink

    An evaluator determines whether or not a failure of a protected program should qualify as a systemic failure to be added to the CircuitBreaker statistics and used to determine whether the failure threshold has been reached and the circuit breaker should be opened.

    An evaluator determines whether or not a failure of a protected program should qualify as a systemic failure to be added to the CircuitBreaker statistics and used to determine whether the failure threshold has been reached and the circuit breaker should be opened. A program can fail for many reasons, including application-level errors, and it is often not desirable to count these as failures a circuit breaker should keep track of (they may have no bearing on errors which could cause cascading failures). Different subsystems may look for different error or exception hierarchies in this determination (e.g., a circuit breaker protecting a database access program may provide an evaluator that looks for exceptions related to the API used to access the database).

  5. final case class Identifier(value: String) extends AnyVal with Product with Serializable

    Permalink

    Uniquely identifies a CircuitBreaker within the CircuitBreakerRegistry.

  6. case class OpenException(id: Identifier, stats: FailureStatistics) extends CircuitBreakerException with Product with Serializable

    Permalink

    This data type represents the error returned when the CircuitBreaker is failing a request because the configured percentage of failures of the protected program has exceeded the configured maximum threshold over the configured time period.

    This data type represents the error returned when the CircuitBreaker is failing a request because the configured percentage of failures of the protected program has exceeded the configured maximum threshold over the configured time period.

    id

    - identifies the CircuitBreaker which triggered this error.

    stats

    - the statistics.FailureStatistics which provide details on the current state of the CircuitBreaker.

  7. case class OpenedEvent(id: Identifier, stats: FailureStatistics) extends CircuitBreakerEvent with Product with Serializable

    Permalink

    This event is published whenever a CircuitBreaker is "opened" (causing subsequent requests to fail fast excepting for periodic tests).

    This event is published whenever a CircuitBreaker is "opened" (causing subsequent requests to fail fast excepting for periodic tests).

    id

    - identifies the CircuitBreaker which triggered this event.

    stats

    - the statistics.FailureStatistics which provide details on the current state of the CircuitBreaker.

  8. case class ThrottledDownEvent(id: Identifier, stats: FlowControlStatistics) extends CircuitBreakerEvent with Product with Serializable

    Permalink

    This event is published whenever a CircuitBreaker is throttling down requests.

    This event is published whenever a CircuitBreaker is throttling down requests. This means that the acceptable inbound rate has lowered based on observation that the processing rate for the program has degraded.

    id

    - identifies the CircuitBreaker which triggered this event.

    stats

    - the statistics.FlowControlStatistics which provide details on the current state of the CircuitBreaker.

  9. case class ThrottledException(id: Identifier, stats: FlowControlStatistics) extends CircuitBreakerException with Product with Serializable

    Permalink

    This data type represents the error returned when the CircuitBreaker is failing a request as a means of throttling the input rate to bring it down to the average observed rate at which the underlying program can process them or to a configured hard limit.

    This data type represents the error returned when the CircuitBreaker is failing a request as a means of throttling the input rate to bring it down to the average observed rate at which the underlying program can process them or to a configured hard limit.

    id

    - identifies the CircuitBreaker which triggered this error.

    stats

    - the statistics.FlowControlStatistics which provide details on the current state of the CircuitBreaker.

  10. case class ThrottledUpEvent(id: Identifier, stats: FlowControlStatistics) extends CircuitBreakerEvent with Product with Serializable

    Permalink

    This event is published whenever a CircuitBreaker is throttling up requests.

    This event is published whenever a CircuitBreaker is throttling up requests. This means that the acceptable inbound rate has risen based on observation that the processing rate has decreased/improved.

    id

    - identifies the CircuitBreaker which triggered this event.

    stats

    - the statistics.FlowControlStatistics which provide details on the current state of the CircuitBreaker.

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object FailureEvaluator

    Permalink

    The FailureEvaluator companion object, providing smart constructor and a default evaluator.

  5. object OpenException extends Serializable

    Permalink
  6. object ThrottledException extends Serializable

    Permalink
  7. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def forFailure[F[_]](id: Identifier, config: FailureSettings, evaluator: FailureEvaluator, publishEvent: (CircuitBreakerEvent) ⇒ F[Unit])(implicit F: Sync[F]): F[CircuitBreaker[F]]

    Permalink

    Smart constructor, normally not called directly but rather by the CircuitBreakerRegistry to create a CircuitBreaker instance which protects against cascading failure.

    Smart constructor, normally not called directly but rather by the CircuitBreakerRegistry to create a CircuitBreaker instance which protects against cascading failure.

    id

    - uniquely identifies a CircuitBreaker instance within the CircuitBreakerRegistry.

    config

    - the FailureSettings configuration for the CircuitBreaker.

    evaluator

    - the FailureEvaluator to use for the CircuitBreaker, used to determine what program errors should be used to determine state changes.

    publishEvent

    - the function to call in order to publish an event - the CircuitBreakerRegistry, for instance, provides a function which takes the event and returns an effectful program that when run will publish to an fs2.Stream which interested clients can subscribe to.

    returns

    circuitBreaker - an effectful program that when run will return an instance of a failure CircuitBreaker.

  13. def forFlowControl[F[_]](id: Identifier, config: FlowControlSettings, evaluator: FailureEvaluator, publishEvent: (CircuitBreakerEvent) ⇒ F[Unit])(implicit F: Sync[F]): F[CircuitBreaker[F]]

    Permalink

    Smart constructor, normally not called directly but rather by the CircuitBreakerRegistry to create a CircuitBreaker instance which protects against both cascading failure and system overload.

    Smart constructor, normally not called directly but rather by the CircuitBreakerRegistry to create a CircuitBreaker instance which protects against both cascading failure and system overload.

    id

    - uniquely identifies a CircuitBreaker instance within the CircuitBreakerRegistry.

    config

    - the FlowControlSettings configuration for the CircuitBreaker.

    evaluator

    - the FailureEvaluator to use for the CircuitBreaker, used to determine what program errors should be used to determine state changes.

    publishEvent

    - the function to call in order to publish an event - the CircuitBreakerRegistry, for instance, provides a function which takes the event and returns an effectful program that when run will publish to an fs2.Stream which interested clients can subscribe to.

    returns

    circuitBreaker - an effectful program that when run will return an instance of a flow control CircuitBreaker.

  14. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef
  20. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped