Chronicle.Connections.LoadBalancer.HttpProbe (cratis_chronicle v2.1.3)

Copy Markdown View Source

Default HTTP transport for Chronicle.Connections.LoadBalancer's :least_connections strategy.

Talks to a Chronicle kernel's GET /connections/count and POST /connections/reserve endpoints via :httpc (built into :inets, so no extra dependency is needed). TLS behavior mirrors the gRPC channel and the OAuth2 token fetch: skipped entirely when disable_tls is set, and certificate validation skipped by default (skip_tls_validation is true unless set to false).

The /connections/count response body is accepted either as a bare integer or as JSON with a count or connections key, since the exact response shape is a Chronicle kernel implementation detail this client doesn't otherwise depend on.

Summary

Functions

Performs the :count or :reserve HTTP probe against address.

Functions

request(atom, address, connection_string)

@spec request(
  :count | :reserve,
  Chronicle.Connections.ConnectionString.ServerAddress.t(),
  Chronicle.Connections.ConnectionString.t()
) :: {:ok, term()} | {:error, term()}

Performs the :count or :reserve HTTP probe against address.