# NOT RUN {
f <- function(x) {x * 3}
openPage(allowedFunctions = "f", allowedVariables = "k", sessionVars = list(k = 0))
k <- getSessionVariable("k")
getPage()$openPage(FALSE)
id1 <- getSessionIds()[1]
id2 <- getSessionIds()[2]
sendCommand("jrc.callFunction('f', [10], 'k')", sessionId = id1, wait = 3)
sendCommand("jrc.callFunction('f', [20], 'k')", sessionId = id2, wait = 3)
k1 <- getSessionVariable("k", id1)
k2 <- getSessionVariable("k", id2)
closePage()
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab