Middleware which counts the active requests and allows for an action to be taken based off the current number of active requests and the current request.
Middleware which counts the active requests and allows for an action to be taken based off the current number of active requests and the current request.
a Sync type.
a Numeric state type, e.g. Long.
report the request count every time it is incremented.
report the request count every time it is decremented.
a function of the number of active requests and the
current Request which yields either a Request or a
Response. If a Response is yielded this has the
effect of bypassing the underlying service.
the middleware.
This function provides the fundamental primitive operations on which the other functions are defined.
This function provides the fundamental primitive operations on which the other functions are defined. It is quite a bit uglier than the higher level middlewares. Unless you have very specific needs, you should avoid using it directly.
Fundamentally takes two effects, one to run when a request is received,
and one to run when a response is emitted. It also takes an action,
which is a function of the current request, which emits an effect of an
Either[Request[F], Response[F]]. If a Right[Response[F]] is emitted,
this will bypass calling the underlying service and immediately return
the generated Response[F] value.
a Sync type.
an effect to run after a request is received.
an effect to run after a response is emitted.
a function of the current Request which yields either a
Request or a Response. If a Response is yielded
this has the effect of bypassing the underlying service.
a pair of a F[S] which can be used to inspect the current
state externally and the middleware.
Middleware which bypasses the service if there are more than a certain number of active requests.
Middleware which bypasses the service if there are more than a certain
number of active requests. When the onMax effect is invoked, this
always indicates that the given Response[F] value is yielded,
bypassing the underlying service.
a Sync type.
a Numeric state type, e.g. Long.
report the request count every time it is incremented.
report the request count every time it is decremented.
an effect to invoke if the permitted maximum number of concurrent requests is exceeded. One might use this for to log the event for example.
the Response to yield when there are too many active
requests.
the maximum number of concurrent requests to allow.
the middleware.
Middleware which returns a 503 (ServiceUnavailable) response after it is processing more than a given number of requests.
Middleware which returns a 503 (ServiceUnavailable) response after it is processing more than a given number of requests.
a Sync type.
a Numeric state type, e.g. Long.
the maximum number of concurrent requests to allow.
the middleware.
Middleware which returns a 503 (ServiceUnavailable) response after it is processing more than a given number of requests.
Middleware which returns a 503 (ServiceUnavailable) response after it is processing more than a given number of requests.
a Sync type.
a Numeric state type, e.g. Long.
report the request count every time it is incremented.
report the request count every time it is decremented.
an effect to invoke if the permitted maximum number of concurrent requests is exceeded. One might use this for to log the event for example.
the maximum number of concurrent requests to allow.
the middleware.
(Since version ) see corresponding Javadoc for more information.
Http4s middleware which allows for introspection based on the number of active requests.