Create, register, list, and remove 'RAVE' sessions
new_session(update = FALSE)use_session(x)
launch_session(
x,
host = "127.0.0.1",
port = NULL,
options = list(jupyter = TRUE, jupyter_port = NULL, as_job = TRUE, launch_browser =
TRUE, single_session = FALSE)
)
session_getopt(keys, default = NA, namespace = "default")
session_setopt(..., .list = NULL, namespace = "default")
remove_session(x)
remove_all_sessions()
list_session(path = session_root(), order = c("none", "ascend", "descend"))
start_session(
session,
new = NA,
host = "127.0.0.1",
port = NULL,
jupyter = NA,
jupyter_port = NULL,
as_job = TRUE,
launch_browser = TRUE,
single_session = FALSE
)
shutdown_session(
returnValue = invisible(),
session = shiny::getDefaultReactiveDomain()
)
new_session
returns a session object with character
'session_id'
and a function 'launch_session'
to launch the
application from this session
use_session
returns a session object, the same as
new_session
under the condition that corresponding session exists,
or raise an error if the session is missing
list_session
returns a list of all existing session objects under the session root
remove_session
returns a logical whether the corresponding session has been found and removed
logical, whether to update to latest 'RAVE' template
host 'IP' address, default is 'localhost'
port to listen
additional options, including jupyter
,
jupyter_port
, as_job
, and launch_browser
vector of characters, one or more keys of which the values should be obtained
default value if key is missing
namespace of the option; default is 'default'
named list of key-value pairs of session options. The keys must be characters, and values must be simple data types (such as numeric vectors, characters)
root path to store the sessions; default is the
"tensor_temp_path"
in raveio_getopt
whether to order the session by date created; choices are
'none'
(default), 'ascend'
, 'descend'
session identification string, or session object; use
list_session
to list all existing sessions
whether to create a new session instead of using the most recent one, default is false
logical, whether to launch 'jupyter' instance as well. It requires additional setups to enable 'jupyter' lab
port used by 'jupyter' lab, can be set by
'jupyter_port'
option in raveio_setopt
whether to launch the application as 'RStudio' job, default is true if 'RStudio' is detected; when running without 'RStudio', this option is always false
whether to launch browser, default is true
whether to enable single-session mode. Under this mode, closing the main frame will terminate 'RAVE' run-time session, otherwise the 'RAVE' instance will still open in the background
passed to stopApp
if(interactive()){
sess <- new_session()
sess$launch_session()
all_sessions <- list_session()
print(all_sessions)
# Use existing session
session_id <- all_sessions[[1]]$session_id
sess <- use_session(session_id)
sess$launch_session()
# Remove session
remove_session(session_id)
list_session()
}
Run the code above in your browser using DataLab