Open Sidebar
Close Sidebar
CrystalDoc.info
Source code
Shards.info
syn
v0.2.0
Syn
ConditionVariable
Core
AtomicLock
ConditionVariable
Future
State
Lockable
Mutex
Type
Once
SpinLock
WaitGroup
WaitList
Iterator
Error
FailedError
Future
Mutex
Pool
RWLock
TimeoutError
WaitGroup
Built with Crystal 1.9.2
2023-10-08 13:03:03 UTC
class
Syn::Pool(T)
Syn::Pool(T)
Reference
Object
Overview
EXPERIMENTAL
Relies on the experimental timeout feature.
Defined in:
pool.cr
Constructors
.new
(capacity : Int32 =
5
, timeout : Time::Span =
5
.seconds, &generator : -> T)
Instance Method Summary
#checkin
(obj : T) : Nil
#checkout
: T
#using
(& : T -> U) : U forall U
Constructor Detail
def self.
new
(capacity : Int32 =
5
, timeout : Time::Span =
5
.seconds, &generator : -> T)
#
[
View source
]
Instance Method Detail
def
checkin
(obj : T) : Nil
#
[
View source
]
def
checkout
: T
#
[
View source
]
def
using
(& : T -> U) : U forall U
#
[
View source
]