Pool {pool} | R Documentation |
A generic pool class that holds objects. These can be fetched
from the pool and released back to it at will, with very
little computational cost. The pool should be created only once
and closed when it is no longer needed, to prevent leaks. See
dbPool
for an example of
object pooling applied to DBI database connections.
poolCreate(factory, minSize = 1, maxSize = Inf, idleTimeout = 60, validationInterval = 600, state = NULL) poolClose(pool)
factory |
A factory function responsible for the generation of
the objects that the pool will hold (ex: for DBI database connections,
this function is |
minSize |
An optional number specifying the minimum number of objects that the pool should have at all times. |
maxSize |
An optional number specifying the maximum number of objects that the pool may have at any time. |
idleTimeout |
The number of seconds that an idle
object will be kept in the pool before it is destroyed (only
applies if the number of objects is over the |
validationInterval |
The minimum number of seconds that
|
state |
A |
pool |
A Pool object previously created with
|
dbPool
,
poolCheckout
, poolReturn