Learn R Programming

languageserver (version 0.3.10)

SessionPool: Session Pool with Many R Sessions

Description

Session Pool with Many R Sessions

Arguments

Examples

Run this code
# NOT RUN {
# create 3 cached r sessions in the pool
pool_size <- 3
pool_name <- "common"
pool <- SessionPool$new(pool_size, pool_name)

# check idle_size before acquiring session
n <- pool$get_idle_size()

# if there are idle sessions, acquire session
session <- pool$acquire()

# check session is not null and then use session
is.null(session)

# use session
# please read R6 Class `Session` documentation

# }

Run the code above in your browser using DataLab