Bulkhead

trait Bulkhead

Limits the number of simultaneous in-flight calls to an external resource

Limits the number of simultaneous in-flight calls to an external resource

A bulkhead limits the resources used by some system by limiting the number of concurrent calls to that system. Calls that exceed that number are rejected with a BulkheadError. To ensure good utilisation of the system, however, there is a queue/buffer of waiting calls.

It also prevents queueing up of requests, which consume resources in the calling system, by rejecting calls when the queue is full.

Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def apply[R, E, A](task: ZIO[R, E, A]): ZIO[R, BulkheadError[E], A]

Call the system protected by the Bulkhead

Call the system protected by the Bulkhead

Value Params
task

Task to execute. When the maximum number of in-flight calls is exceeded, the call will be queued.

Returns

Effect that succeeds with the success of the given task or fails, when executed, with a WrappedError of the task's error, or when not executed, with a BulkheadRejection.

def metrics: UIO[Metrics]

Provides the number of in-flight and queued calls

Provides the number of in-flight and queued calls

Concrete methods

def toPolicy: Policy[Any]