rcloud.session.info {rcloud.support}R Documentation

Get information about an RCloud session

Description

rcloud.session.info retrieves information about an RCloud session.

Usage

rcloud.session.info(id = .session$sessionID, user = .session$username)

Arguments

id

session id, defaults to the current session

user

username of the user owning the session, defaults to the current user

Details

Each connection to RCloud creates a session. A session is specific to a user and running on a specific machine. As such it has all the unix properties such as pid, uid, gid. In compute separation setup the current session will be the compute session (although the control session also exists in parallel).

The mode of the session determines what kind of session was initialized. This allows the notebook to determine how it is being run. Althoiugh the mode can be set to anything in the client the following modes are most often used in regular RCloud:

Value

A list with at least the following entries

id

session ID (typically a GUID)

host

name of the host running the session

script.url

URL to the script service on that host. Note that this is only guaranteed to be valid on the RCloud node, generally it cannot be used from a client

pid

process ID of the session

uname

unix username

uid

unix user id

gid

unix group id

user

notebook store username

mode

type of the session (see Details section)

start

timestamp of the session start

Author(s)

Simon Urbanek

Examples

Run examples

  str(rcloud.session.info())

  # use direct output in IDE and RCloud Web otherwise
  # so that we see output in both cases
  if (rcloud.session.info()$mode == "IDE") {
     rcloud.html.out("<h2>Hello, World!</h2>")
  } else {
     rcloud.web::rcw.result(body="<h2>Hello, World!</h2>")
  }

[Package rcloud.support version 2.3-1 Index]