final class Builders[F[_]] extends AnyVal with CircuitBreakerDocs
Builders specified for CircuitBreaker, using the Partially-Applied Type technique.
- Source
- CircuitBreaker.scala
- Alphabetic
- By Inheritance
- Builders
- CircuitBreakerDocs
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Builders(F: Sync[F])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##(): Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- val F: Sync[F]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def of(maxFailures: Int, resetTimeout: FiniteDuration, exponentialBackoffFactor: Double = 1.0, maxResetTimeout: Duration = Duration.Inf, onRejected: F[Unit] = F.unit, onClosed: F[Unit] = F.unit, onHalfOpen: F[Unit] = F.unit, onOpen: F[Unit] = F.unit, padding: PaddingStrategy = NoPadding)(implicit clock: Clock[F]): F[CircuitBreaker[F]]
Safe builder for a CircuitBreaker reference.
Safe builder for a CircuitBreaker reference.
- maxFailures
is the maximum count for failures before opening the circuit breaker
- resetTimeout
is the timeout to wait in the
Open
state before attempting a close of the circuit breaker (but without the backoff factor applied)- exponentialBackoffFactor
is a factor to use for resetting the
resetTimeout
when in theHalfOpen
state, in case the attempt toClose
fails- maxResetTimeout
is the maximum timeout the circuit breaker is allowed to use when applying the
exponentialBackoffFactor
- onRejected
is a callback for signaling rejected tasks, so every time a task execution is attempted and rejected in Open or HalfOpen states
- onClosed
is a callback for signaling transitions to the Closed state
- onHalfOpen
is a callback for signaling transitions to HalfOpen
- onOpen
is a callback for signaling transitions to Open
- padding
is the PaddingStrategy to apply to the underlying atomic reference used, to use in case contention and "false sharing" become a problem
- def toString(): String
- Definition Classes
- Any
- def unsafe(maxFailures: Int, resetTimeout: FiniteDuration, exponentialBackoffFactor: Double = 1.0, maxResetTimeout: Duration = Duration.Inf, onRejected: F[Unit] = F.unit, onClosed: F[Unit] = F.unit, onHalfOpen: F[Unit] = F.unit, onOpen: F[Unit] = F.unit, padding: PaddingStrategy = NoPadding)(implicit clock: Clock[F]): CircuitBreaker[F]
Unsafe builder, an alternative to CircuitBreaker[F].of for people knowing what they are doing.
Unsafe builder, an alternative to CircuitBreaker[F].of for people knowing what they are doing.
UNSAFE WARNING: this builder is unsafe to use because creating a circuit breaker allocates shared mutable states, which violates referential transparency. Prefer to use the safe CircuitBreaker[F].of and pass that
CircuitBreaker
around as a plain parameter.- maxFailures
is the maximum count for failures before opening the circuit breaker
- resetTimeout
is the timeout to wait in the
Open
state before attempting a close of the circuit breaker (but without the backoff factor applied)- exponentialBackoffFactor
is a factor to use for resetting the
resetTimeout
when in theHalfOpen
state, in case the attempt toClose
fails- maxResetTimeout
is the maximum timeout the circuit breaker is allowed to use when applying the
exponentialBackoffFactor
- onRejected
is a callback for signaling rejected tasks, so every time a task execution is attempted and rejected in Open or HalfOpen states
- onClosed
is a callback for signaling transitions to the Closed state
- onHalfOpen
is a callback for signaling transitions to HalfOpen
- onOpen
is a callback for signaling transitions to Open
- padding
is the PaddingStrategy to apply to the underlying atomic reference used, to use in case contention and "false sharing" become a problem
- Annotations
- @UnsafeBecauseImpure()
This is the API documentation for the Monix library.
Package Overview
monix.execution exposes lower level primitives for dealing with asynchronous execution:
Atomic
types, as alternative tojava.util.concurrent.atomic
monix.catnap exposes pure abstractions built on top of the Cats-Effect type classes:
monix.eval is for dealing with evaluation of results, thus exposing Task and Coeval.
monix.reactive exposes the
Observable
pattern:Observable
implementationsmonix.tail exposes Iterant for purely functional pull based streaming:
Batch
andBatchCursor
, the alternatives to Scala'sIterable
andIterator
respectively that we are using within Iterant's encodingYou can control evaluation with type you choose - be it Task, Coeval, cats.effect.IO or your own as long as you provide correct cats-effect or cats typeclass instance.