hackney_pool_handler behaviour (hackney v1.24.0)

View Source

Summary

Types

client/0

-type client() ::
          #client{start_time :: term(),
                  mod_metrics :: term(),
                  transport :: term(),
                  host :: term(),
                  port :: term(),
                  netloc :: term(),
                  options :: term(),
                  socket :: term(),
                  socket_ref :: term(),
                  request_ref :: term(),
                  dynamic :: term(),
                  pool_handler :: term(),
                  recv_timeout :: term(),
                  follow_redirect :: term(),
                  max_redirect :: term(),
                  force_redirect :: term(),
                  retries :: term(),
                  redirect :: term(),
                  location :: term(),
                  parser :: term(),
                  headers :: term(),
                  state :: term(),
                  response_state :: term(),
                  mp_boundary :: term(),
                  req_type :: term(),
                  expect :: term(),
                  async :: term(),
                  with_body :: term(),
                  max_body :: term(),
                  stream_to :: term(),
                  send_fun :: term(),
                  body_state :: term(),
                  multipart :: term(),
                  req_chunk_size :: term(),
                  buffer :: term(),
                  partial_headers :: term(),
                  version :: term(),
                  clen :: term(),
                  te :: term(),
                  connection :: term(),
                  method :: term(),
                  path :: term(),
                  ctype :: term()}.

host/0

-type host() :: binary() | string().

Callbacks

checkin/2

-callback checkin({Info :: any(), CheckingReference :: any(), Owner :: pid(), Transport :: atom()},
                  Socket :: inet:socket()) ->
                     ok | {error, Reason :: any()}.

checkout/4

-callback checkout(Host :: host(), Port :: integer(), Transport :: atom(), Client :: client()) ->
                      {ok,
                       {Info :: any(), CheckingReference :: any(), Owner :: pid(), Transport :: atom()},
                       Socket :: inet:socket()} |
                      {error, Reason :: any()}.

notify/2

-callback notify(Pool :: atom(), Message :: any()) -> ok.

start/0

-callback start() -> ok | {error, Reason :: any()}.