Throttler

dev.kovstas.fs2throttler.Throttler
object Throttler

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Throttler.type

Members list

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

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait ThrottleMode
class Object
trait Matchable
class Any
Show all
Self type
Enforcing.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

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

Describe how to deal with exceed rate.

Describe how to deal with exceed rate.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Enforcing
object Shaping

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.

Value parameters

duration

the period time in which emitted elements must meet

elements

the allowed number of elements

mode

the throttle mode ThrottleMode

Attributes

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.

Value parameters

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

Attributes

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.

Value parameters

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

Attributes

Returns

fs2.Pipe