livery_client_concurrency (livery v0.2.0)

View Source

Client layer: cap in-flight requests.

A lock-free atomics counter admits up to limit concurrent requests through this layer; past the cap a request returns {error, overloaded} without calling downstream. Add it with livery_client:concurrency/1.

Summary

Types

state()

-opaque state()

Functions

call/3

-spec call(livery_client:request(), livery_client:next(), state()) ->
              {ok, livery_client:response()} | {error, term()}.

limiter(Limit)

-spec limiter(non_neg_integer()) -> state().