if (FALSE) {
# Not run:
# Define worker function
my_task <- function(task_id, param1, param2) {
out_file <- sprintf("results/task_%04d.Rds", task_id)
if (file.exists(out_file)) return() # Skip if done
result <- expensive_computation(task_id, param1, param2)
saveRDS(result, out_file)
}
# Run worker locally (for testing)
worker("test_project", my_task, param1 = 10, param2 = "value")
}
Run the code above in your browser using DataLab