# NOT RUN {
## Check the default daemon name and task ID
## These will be used in the subsequent calls
## in this example
lastRegisteredDaemon()
lastRegisteredTaskId()
## Register a daemon using the default daemon name
registerDaemon()
daemonLogs()
## Check if the daemon is running
daemonExists()
## Set a task run by the daemon
daemonSetTask(message("Hello from daemon"))
## See the daemon log for the output
Sys.sleep(1)
daemonLogs()
## Get the task expression from the daemon
daemonGetTask()
## Export an object to the task in the daemon
daemonExport(i = 1)
## Evaluate an expression in the daemon
daemonEval(i)
## Close the connection to the daemon and remove the task
## set by this process
## The daemon will silently quit after a few minutes
## if no other tasks exist.
deregisterDaemon()
daemonExists()
## explicitly kill the daemon if you are impatient
killDaemon()
daemonExists()
# }
Run the code above in your browser using DataLab