Throttler

dev.kovstas.fs2throttler.Throttler$
object Throttler

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Classlikes

case object Enforcing extends ThrottleMode

The mode that skips elements to meet the required rate.

The mode that skips elements to meet the required rate.

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Self type
case object Shaping extends ThrottleMode

The mode that make pauses before emitting elements of the stream to meet the required rate.

The mode that make pauses before emitting elements of the stream to meet the required rate.

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Self type
Shaping.type
sealed trait ThrottleMode

Describe how to deal with exceed rate.

Describe how to deal with exceed rate.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Enforcing.type
object Shaping.type

Value members

Concrete methods

def throttle[F[_] : Temporal, O](elements: Long, duration: FiniteDuration, mode: ThrottleMode): (F, O) => O

The pipe that uses the token bucket algorithm to throttle elements of the stream according to the given rate.

The pipe that uses the token bucket algorithm to throttle elements of the stream according to the given rate.

Attributes

duration

the period time in which emitted elements must meet

elements

the allowed number of elements

mode

the throttle mode ThrottleMode

Returns:

fs2.Pipe

def throttle[F[_] : Temporal, O](elements: Long, duration: FiniteDuration, mode: ThrottleMode, burst: Long): (F, O) => O

The pipe that uses the token bucket algorithm to throttle elements of the stream according to the given rate.

The pipe that uses the token bucket algorithm to throttle elements of the stream according to the given rate.

Attributes

burst

increase the capacity threshold

duration

the period time in which emitted elements must meet

elements

the allowed number of elements

mode

the throttle mode ThrottleMode

Returns:

fs2.Pipe

def throttle[F[_] : Temporal, O](elements: Long, duration: FiniteDuration, mode: ThrottleMode, burst: Long, fnCost: O => F[Long]): (F, O) => O

The pipe that uses the token bucket algorithm to throttle elements of the stream according to the given rate, the burst and elements cost.

The pipe that uses the token bucket algorithm to throttle elements of the stream according to the given rate, the burst and elements cost.

Attributes

burst

increase the capacity threshold

duration

the period time in which emitted elements must meet

elements

the allowed number of elements

fnCost

calculate a cost of the element

mode

the throttle mode ThrottleMode

Returns:

fs2.Pipe