Skip to content

Latest commit

 

History

History
159 lines (71 loc) · 3.99 KB

hackney_pool.md

File metadata and controls

159 lines (71 loc) · 3.99 KB

#Module hackney_pool#

pool of sockets connections.

Behaviours: gen_server.

##Function Index##

child_spec/2return a child spec suitable for embeding your pool in the supervisor.
code_change/3
handle_call/3
handle_cast/2
handle_info/2
init/1
max_poolsize/1get max pool size.
pool_size/1get total pool size.
pool_size/2get the pool size for {Transport, Host0, Port}
release/3release a socket in the pool.
set_poolsize/2change the pool size.
set_timeout/2change the connection timeout.
socket/2fetch a socket from the pool.
start_link/0
start_link/1
start_pool/2start a pool.
stop_pool/1stop a pool.
terminate/2
timeout/1get timeout.

##Function Details##

###child_spec/2##

child_spec(Name, Options0) -> any()

return a child spec suitable for embeding your pool in the supervisor

###code_change/3##

code_change(OldVsn, State, Extra) -> any()

###handle_call/3##

handle_call(X1, From, State) -> any()

###handle_cast/2##

handle_cast(Msg, State) -> any()

###handle_info/2##

handle_info(X1, State) -> any()

###init/1##

init(Options) -> any()

###max_poolsize/1##

max_poolsize(PidOrName) -> any()

get max pool size

###pool_size/1##

pool_size(PidOrName) -> any()

get total pool size

###pool_size/2##

pool_size(PidOrName, X2) -> any()

get the pool size for {Transport, Host0, Port}

###release/3##

release(PidOrName, X2, Socket) -> any()

release a socket in the pool

###set_poolsize/2##

set_poolsize(PidOrName, NewSize) -> any()

change the pool size

###set_timeout/2##

set_timeout(PidOrName, NewTimeout) -> any()

change the connection timeout

###socket/2##

socket(PidOrName, X2) -> any()

fetch a socket from the pool

###start_link/0##

start_link() -> any()

###start_link/1##

start_link(Options0) -> any()

###start_pool/2##

start_pool(Name, Options) -> any()

start a pool

###stop_pool/1##

stop_pool(Name) -> any()

stop a pool

###terminate/2##

terminate(Reason, State) -> any()

###timeout/1##

timeout(PidOrName) -> any()

get timeout