freshness v0.2.1 Freshness.Server View Source

A genserver module holding open connections to the same (host, port, protocol) socket. It is meant as a light-weight pooling mechanism that exposes raw mint replies

Link to this section Summary

Link to this section Types

Link to this type

t()

View Source
t() :: %Freshness.Server{pending: term(), pool: term()}

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

request(server, method, path, headers \\ [], body \\ "")

View Source
request(
  GenServer.server(),
  method :: String.t(),
  path :: String.t(),
  Mint.Types.headers(),
  body :: iodata() | nil | :stream
) :: {:ok, Freshness.Response.t()} | {:error, term()}
Link to this function

start_link(config)

View Source
start_link(Freshness.Config.t()) :: :ignore | {:error, any()} | {:ok, pid()}