jrc (version 0.3.0)

limitStorage: Change size of the message storage

Description

This function allows to change number or total size of the messages that are received via the websocket and are stored in memory.

Usage

limitStorage(n = NULL, size = NULL, sessionId = NULL)

Arguments

n

Maximum number of messages that can be stored simultaneously.

size

Maximum total size of all stored messages in bytes.

sessionId

ID of the session, for which the storage size should be changed. Can also be a vector of session IDs to change storage size for multiple sessions at once. If NULL, changes will be applied to all currently active sessions.

Details

For security reasons, control of the currently running R session is limited to calling and changing only some user specified functions and variables. All other messages are stored in memory and can be later processed by calling authorize function. To prevent overuse of memory, one can limit size of the storage by number of messages or by their total size estimated by object.size. If the storage grows above these limits, older messages are removed. The last received message will not be removed even if it takes more memory than is allowed. If any of the size parameters are set to zero, no massages will be stored. In this case, any message that requires authorization will be automatically discarded.

One can also directly change public fields maxN and maxSize of any object of class Session (see also getSession).

See Also

authorize, allowFunctions, allowVariables.

Examples

Run this code
# NOT RUN {
openPage()
limitStorage(n = 10)
limitStorage(size = 10 * 1024^2)
closePage()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab