Skip to content

Commit

Permalink
Only marshal on actual worker send
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Apr 13, 2024
1 parent 5b9dc78 commit fd68951
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions R/class_builder.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ target_prepare.tar_builder <- function(
)
builder_ensure_deps(target, pipeline, "main")
builder_update_subpipeline(target, pipeline)
builder_marshal_subpipeline(target)
}

# nocov start
Expand Down Expand Up @@ -127,7 +126,6 @@ target_run.tar_builder <- function(target, envir, path_store) {
target$subpipeline <- NULL
})
target_gc(target)
builder_unmarshal_subpipeline(target)
builder_ensure_deps(target, target$subpipeline, "worker")
frames <- frames_produce(envir, target, target$subpipeline)
builder_set_tar_runtime(target, frames, path_store)
Expand All @@ -154,6 +152,7 @@ target_run_worker.tar_builder <- function(
tar_runtime$fun <- fun
tar_options$import(options)
set_envvars(envvars)
builder_unmarshal_subpipeline(target)
target_run(target, envir, path_store)
builder_marshal_value(target)
target
Expand Down
1 change: 1 addition & 0 deletions R/class_clustermq.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ clustermq_class <- R6::R6Class(
run_target = function(name) {
target <- pipeline_get_target(self$pipeline, name)
target_prepare(target, self$pipeline, self$scheduler, self$meta)
builder_marshal_subpipeline(target)
self$sync_meta_time()
if_any(
target_should_run_worker(target),
Expand Down
1 change: 1 addition & 0 deletions R/class_crew.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ crew_class <- R6::R6Class(
meta = self$meta,
pending = FALSE
)
builder_marshal_subpipeline(target)
self$sync_meta_time()
self$controller$push(
command = command,
Expand Down
1 change: 1 addition & 0 deletions R/class_future.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ future_class <- R6::R6Class(
run_target = function(name) {
target <- pipeline_get_target(self$pipeline, name)
target_prepare(target, self$pipeline, self$scheduler, self$meta)
builder_marshal_subpipeline(target)
self$sync_meta_time()
if_any(
target_should_run_worker(target),
Expand Down

0 comments on commit fd68951

Please sign in to comment.