diff --git a/R/extended-task.R b/R/extended-task.R index e00d1afe5e..5af62d197e 100644 --- a/R/extended-task.R +++ b/R/extended-task.R @@ -54,7 +54,11 @@ ExtendedTask <- R6Class("ExtendedTask", portable = TRUE, #' [\{promises\}](https://rstudio.github.io/promises/) package, most #' likely in conjuction with the #' [\{future\}](https://rstudio.github.io/promises/articles/promises_04_futures.html) - #' package. It's also important that this logic does not read from any + #' package. (In short, the return value of `func` should be a + #' [`Future`][future::future()] object, or a `promise`, or something else + #' that [promises::as.promise()] understands.) + #' + #' It's also important that this logic does not read from any #' reactive inputs/sources, as inputs may change after the function is #' invoked; instead, if the function needs to access reactive inputs, it #' should take parameters and the caller of the `invoke()` method should @@ -90,6 +94,9 @@ ExtendedTask <- R6Class("ExtendedTask", portable = TRUE, invisible(NULL) }, #' @description + #' This is a reactive read that invalidates the caller when the task's + #' status changes. + #' #' Returns one of the following values: #' #' * `"initial"`: This `ExtendedTask` has not yet been invoked @@ -98,9 +105,6 @@ ExtendedTask <- R6Class("ExtendedTask", portable = TRUE, #' retrieved via the `result()` method #' * `"error"`: An invocation completed with an error, which will be #' re-thrown if you call the `result()` method - #' - #' This is a reactive read that invalidates the caller when the task's - #' status changes. status = function() { private$rv_status() }, diff --git a/man/ExtendedTask.Rd b/man/ExtendedTask.Rd index 6998dd4382..8e6a81378c 100644 --- a/man/ExtendedTask.Rd +++ b/man/ExtendedTask.Rd @@ -74,7 +74,11 @@ asynchronous function, meaning, it should use the \href{https://rstudio.github.io/promises/}{\{promises\}} package, most likely in conjuction with the \href{https://rstudio.github.io/promises/articles/promises_04_futures.html}{\{future\}} -package. It's also important that this logic does not read from any +package. (In short, the return value of \code{func} should be a +\code{\link[future:future]{Future}} object, or a \code{promise}, or something else +that \code{\link[promises:is.promise]{promises::as.promise()}} understands.) + +It's also important that this logic does not read from any reactive inputs/sources, as inputs may change after the function is invoked; instead, if the function needs to access reactive inputs, it should take parameters and the caller of the \code{invoke()} method should @@ -110,6 +114,9 @@ arguments.} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-ExtendedTask-status}{}}} \subsection{Method \code{status()}}{ +This is a reactive read that invalidates the caller when the task's +status changes. + Returns one of the following values: \itemize{ \item \code{"initial"}: This \code{ExtendedTask} has not yet been invoked @@ -119,9 +126,6 @@ retrieved via the \code{result()} method \item \code{"error"}: An invocation completed with an error, which will be re-thrown if you call the \code{result()} method } - -This is a reactive read that invalidates the caller when the task's -status changes. \subsection{Usage}{ \if{html}{\out{
}}\preformatted{ExtendedTask$status()}\if{html}{\out{
}} }