Skip to contents

Creates a [shiny::ExtendedTask()] that executes the artwork processing pipeline in a background R session. Enables async processing without blocking the Shiny session, allowing users to continue interacting with the app while artwork is processed.

Usage

new_pipeline_task()

Value

A `shiny::ExtendedTask` object. Use `$invoke(...)` to start processing with pipeline parameters, `$status()` to monitor execution (`"initial"`, `"running"`, or `NULL` when complete), and `$result()` to retrieve output.

Details

The task wraps [run_pipeline()] and uses {future} for background execution and {promises} for result handling.

See also

* [run_pipeline()] for pipeline execution logic * [modUploadServer()] for integration and usage context * [shiny::ExtendedTask()] for async task documentation

Other pipeline: pipeline, run_pipeline()

Examples

if (FALSE) { # \dontrun{
# In modUploadServer
pipeline <- new_pipeline_task()

# Start processing
pipeline$invoke(
  artist = r$artist,
  artwork = artcore::gen_artwork_id(),
  collection = input$art_collection,
  art_title = input$art_name,
  file_image = input$image_file$datapath
)

# Monitor status
shiny::observeEvent(pipeline$status(), {
  if (pipeline$status() != "running") {
    result <- pipeline$result()
    if (!is.null(result)) {
      shiny::showNotification("Artwork ready!")
    }
  }
})
} # }