lhttpc_manager (lhttpc v4.3.2)
connection_count/0
and connection_count/1
. The gen_server is supposed to be started by a supervisor, which is normally lhttpc_sup
.
Summary
Functions
Returns the total number of active clients maintained by the specified lhttpc pool (manager).
A client has finished one request and returns the socket to the pool, which can be new or not.
Returns the total number of active connections maintained by the specified lhttpc pool (manager).
Returns the number of active connections to the specific
Destination
maintained by the httpc manager.Returns the current settings in state for the specified lhttpc pool (manager).
If call contains pool_ensure option, dynamically create the pool with configured parameters. Checks the pool for a socket connected to the destination and returns it if it exists, 'undefined' otherwise.
Lists all the pools already started.
Sets the maximum pool size for the specified pool.
Starts and link to the gen server. This is normally called by a supervisor.
Starts and link to the gen server (with options). This is normally called by a supervisor.
Updates the timeout for persistent connections. This will only affect future sockets handed to the manager. The sockets already managed will keep their timers.
Types
Link to this type
state/0
-type state() :: #state{destinations :: term(), sockets :: term(), clients :: term(), queues :: term(), max_pool_size :: non_neg_integer(), timeout :: non_neg_integer()}.
Functions
Link to this function
client_count(PidOrName)
-spec client_count(lhttpc:pool_id()) -> non_neg_integer().
Link to this function
client_done(Pool, Host, Port, Ssl, Socket)
-spec client_done(pid(), lhttpc:host(), lhttpc:port_num(), boolean(), lhttpc:socket()) -> ok.
Link to this function
code_change(_, State, _)
Link to this function
connection_count(PidOrName)
-spec connection_count(lhttpc:pool_id()) -> non_neg_integer().
Link to this function
connection_count(PidOrName, _)
-spec connection_count(lhttpc:pool_id(), lhttpc:destination()) -> non_neg_integer().
Destination
maintained by the httpc manager.
Link to this function
dump_settings(PidOrName)
-spec dump_settings(lhttpc:pool_id()) -> list().
Link to this function
ensure_call(Pool, Pid, Host, Port, Ssl, Options)
-spec ensure_call(lhttpc:pool_id(), pid(), lhttpc:host(), lhttpc:port_num(), boolean(), lhttpc:options()) -> lhttpc:socket() | no_socket.
Link to this function
handle_call(_, From, State)
Link to this function
handle_cast(_, State)
Link to this function
handle_info(_, State)
Link to this function
init(Options)
Link to this function
list_pools()
-spec list_pools() -> term().
Link to this function
set_max_pool_size(PidOrName, Size)
-spec set_max_pool_size(lhttpc:pool_id(), non_neg_integer()) -> ok.
Link to this function
start_link()
-spec start_link() -> {ok, pid()} | {error, already_started}.
Link to this function
start_link(Options0)
-spec start_link([{atom(), non_neg_integer()}]) -> {ok, pid()} | {error, already_started}.
Link to this function
terminate(_, State)
Link to this function
update_connection_timeout(PidOrName, Milliseconds)
-spec update_connection_timeout(lhttpc:pool_id(), non_neg_integer()) -> ok.