class NNTP::Pool(T)
- NNTP::Pool(T)
- Reference
- Object
Defined in:
nntp/pool.crConstructors
Instance Method Summary
- #checkout : T
- #checkout(&block : T -> )
-
#checkout_some(candidates : Enumerable(WeakRef(T))) : Tuple(T, Bool)
selected, is_candidate = pool.checkout_some(candidates)
selected
be a resource from thecandidates
list andis_candidate
==true
orselected
will be a new resource andis_candidate
==false
-
#close : Nil
close all resources in the pool
- #release(resource : T) : Nil
-
#stats
Returns stats of the pool
Constructor Detail
def self.new(initial_pool_size : Int32 = 1, max_pool_size : Int32 = 0, max_idle_pool_size : Int32 = 1, checkout_timeout : Float64 = 5.0, retry_attempts : Int32 = 1, retry_delay : Float64 = 0.2, &factory : -> T)
#
Instance Method Detail
def checkout_some(candidates : Enumerable(WeakRef(T))) : Tuple(T, Bool)
#
selected, is_candidate = pool.checkout_some(candidates)
selected
be a resource from the candidates
list and is_candidate
== true
or selected
will be a new resource and is_candidate
== false