buoy_pool (buoy v0.2.6)
View SourceSummary
Types
-type buoy_resp() :: #buoy_resp{state :: body | done, body :: undefined | binary(), content_length :: undefined | non_neg_integer() | chunked, headers :: undefined | [binary()], reason :: undefined | binary(), status_code :: undefined | 100..505}.
-type buoy_url() :: #buoy_url{host :: host(), hostname :: hostname(), path :: path(), port :: inet:port_number(), protocol :: protocol_http()}.
-type host() :: binary().
-type hostname() :: binary().
-type option() :: {backlog_size, pos_integer()} | {pool_size, pos_integer()} | {pool_strategy, random | round_robin} | {reconnect, boolean()} | {reconnect_time_max, pos_integer() | infinity} | {reconnect_time_min, pos_integer()} | {socket_options, [gen_tcp:connect_option() | ssl:tls_client_option()]}.
-type options() :: [option()].
-type path() :: binary().
-type protocol_http() :: http | https.
Functions
-spec init() -> ok.
-spec lookup(protocol_http(), hostname(), inet:port_number()) -> {ok, atom()} | {error, pool_not_started | buoy_not_started}.
-spec start(buoy_url()) -> ok | {error, pool_already_started | buoy_not_started}.
-spec stop(buoy_url()) -> ok | {error, pool_not_started | buoy_not_started}.
-spec terminate() -> ok.