Ferry

ferry.Ferry
See theFerry companion object
trait Ferry[-I, +E, +A]

Coalesces individual calls into batched calls to an external system, and limits the load put on it.

Each input submitted through apply is queued. Queued inputs are dispatched together in a single batch call when maxBatchSize inputs have accumulated, or at the latest maxBatchDelay after the oldest of them was submitted. At most maxInFlightBatches batch calls run at the same time, and at most maxQueueing inputs wait for a batch: beyond that, calls are rejected immediately rather than piling up.

Every caller receives its own share of the batch result, or the batch call's failure.

Attributes

Companion
object
Source
Ferry.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def apply(input: I): IO[FerryError[E], A]

Submits input for inclusion in the next batch and waits for its result.

Submits input for inclusion in the next batch and waits for its result.

Fails with FerryError.Rejected when the queue is full, or with FerryError.Failed when the batch call carrying input fails. A defect in the batch call is propagated as a defect. Interrupting the caller before its batch is dispatched removes input from the batch. Calls made after the Ferry's scope has closed are interrupted.

Attributes

Source
Ferry.scala
def metrics: UIO[Metrics]

Current load, for monitoring.

Current load, for monitoring.

Attributes

Source
Ferry.scala