ConcurrentRequests

Middlewares for tracking the quantity of concurrent requests.

These are generalized middlewares and can be used to implement metrics, logging, max concurrent requests, etc.

Note

The concurrent request count is decremented on the completion of the Response body, or in the event of any error, and is guaranteed to only occur once.

class Object
trait Matchable
class Any

Value members

Concrete methods

def app[F[_]](onIncrement: Long => F[Unit], onDecrement: Long => F[Unit])(implicit evidence$7: Async[F]): F[Kleisli[F, ContextRequest[F, Long], Response[F]] => Kleisli[F, Request[F], Response[F]]]

Run a side effect each time the concurrent request count increments and decrements.

Run a side effect each time the concurrent request count increments and decrements.

Note

Each side effect is given the current number of concurrent requests as an argument.

onIncrement should never be < 1 and onDecrement should never be value < 0.

def app2[F[_], G[_]](onIncrement: Long => G[Unit], onDecrement: Long => G[Unit])(implicit evidence$5: Sync[F], evidence$6: Async[G]): F[Kleisli[G, ContextRequest[G, Long], Response[G]] => Kleisli[G, Request[G], Response[G]]]

Run a side effect each time the concurrent request count increments and decrements.

Run a side effect each time the concurrent request count increments and decrements.

Note

Each side effect is given the current number of concurrent requests as an argument.

onIncrement should never be < 1 and onDecrement should never be value < 0.

This is the same as app, but allows for the inner and outer effect types to differ.

def onChangeApp[F[_]](onChange: Long => F[Unit])(implicit evidence$8: Async[F]): F[Kleisli[F, ContextRequest[F, Long], Response[F]] => Kleisli[F, Request[F], Response[F]]]

As app, but runs the same effect on increment and decrement of the concurrent request count.

As app, but runs the same effect on increment and decrement of the concurrent request count.

def onChangeRoute[F[_]](onChange: Long => F[Unit])(implicit evidence$4: Async[F]): F[F => Long]

As route, but runs the same effect on increment and decrement of the concurrent request count.

As route, but runs the same effect on increment and decrement of the concurrent request count.

def route[F[_]](onIncrement: Long => F[Unit], onDecrement: Long => F[Unit])(implicit evidence$3: Async[F]): F[F => Long]

Run a side effect each time the concurrent request count increments and decrements.

Run a side effect each time the concurrent request count increments and decrements.

Note

Each side effect is given the current number of concurrent requests as an argument.

onIncrement should never be < 1 and onDecrement should never be value < 0.

def route2[F[_], G[_]](onIncrement: Long => G[Unit], onDecrement: Long => G[Unit])(implicit evidence$1: Sync[F], evidence$2: Async[G]): F[G => Long]

Run a side effect each time the concurrent request count increments and decrements.

Run a side effect each time the concurrent request count increments and decrements.

Note

Each side effect is given the current number of concurrent requests as an argument.

onIncrement should never be < 1 and onDecrement should never be value < 0.

This is the same as route, but allows for the inner and outer effect types to differ.