ConcurrentRequests

org.http4s.server.middleware.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.

Attributes

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.

Source
ConcurrentRequests.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

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.

Attributes

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.

Source
ConcurrentRequests.scala
def app2[F[_] : Sync, G[_] : Sync](onIncrement: Long => G[Unit], onDecrement: Long => G[Unit]): 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.

Attributes

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.

Source
ConcurrentRequests.scala

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.

Attributes

Source
ConcurrentRequests.scala
def onChangeRoute[F[_] : Sync](onChange: Long => F[Unit]): 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.

Attributes

Source
ConcurrentRequests.scala
def route[F[_] : Sync](onIncrement: Long => F[Unit], onDecrement: Long => F[Unit]): 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.

Attributes

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.

Source
ConcurrentRequests.scala
def route2[F[_] : Sync, G[_] : Sync](onIncrement: Long => G[Unit], onDecrement: Long => G[Unit]): 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.

Attributes

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.

Source
ConcurrentRequests.scala