| shard_lapply_shared | R Documentation |
A convenience wrapper for list workloads that need supervision and shared inputs. Large atomic list elements are auto-shared based on policy.
shard_lapply_shared(
x,
FUN,
VARS = NULL,
workers = NULL,
...,
policy = shard_apply_policy()
)
x |
A list. |
FUN |
Function of the form |
VARS |
Optional named list of extra variables (auto-shared when large). |
workers |
Number of workers (passed to |
... |
Additional arguments forwarded to |
policy |
A |
This wrapper enforces guardrails to avoid accidental huge gathers: it
estimates the total gathered result size from a probe call and refuses
to run if it exceeds policy$max_gather_bytes.
A list of results, one per element of x.
res <- shard_lapply_shared(as.list(1:4), function(x) x^2)
pool_stop()
res
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.