poolCheckout | R Documentation |
Use poolCheckout()
to check out an object from the pool and
poolReturn()
to return it. You will receive a warning if all objects
aren't returned before the pool is closed.
localCheckout()
is a convenience function that can be used inside
functions (and other function-scoped operations like shiny::reactive()
and local()
). It checks out an object and automatically returns it when
the function exits
Note that validation is only performed when the object is checked out, so you generally want to keep the checked out around for as little time as possible.
poolCheckout(pool)
## S4 method for signature 'Pool'
poolCheckout(pool)
poolReturn(object)
## S4 method for signature 'ANY'
poolReturn(object)
localCheckout(pool, env = parent.frame())
pool |
The pool to get the object from. |
object |
Object to return |
env |
Environment corresponding to the execution frame. For expert use only. |
pool <- dbPool(RSQLite::SQLite())
con <- poolCheckout(pool)
con
poolReturn(con)
f <- function() {
con <- localCheckout(pool)
# do something ...
}
f()
poolClose(pool)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.