Skip to content

Instantly share code, notes, and snippets.

View abhijith-asok's full-sized avatar

Abhijith Asok abhijith-asok

View GitHub Profile
@jcheng5
jcheng5 / create_forked_task.R
Last active August 3, 2022 17:11
Concurrent, forked, cancellable tasks in Shiny
library(shiny)
# Also uses parallel, shinyjs, tools
# Create a long-running task, executed in a forked process. (Doesn't work on Windows)
#
# The return value is a promise-like object with three
# methods:
# - completed(): FALSE initially, then TRUE if the task succeeds,
# fails, or is cancelled. Reactive, so when the state changes
# any reactive readers will invalidate.