Bulk queuing

Usage

enqueue_bulk(X, FUN, rrq, do.call = FALSE, group = NULL, period = 1, delete_tasks = FALSE, progress_bar = TRUE, env = parent.frame())
enqueue_bulk_submit(X, FUN, rrq, do.call = FALSE, group = NULL, progress_bar = TRUE, env = parent.frame())

Arguments

X
An object to loop over. If a list, we'll loop over the elements of the list, duplicating the behaviour of rrqlapply except for not handling dots. If a data.frame we'll loop over the rows. Matrices are not supported.
FUN
A function. Will be found in the same way as FUN within rrqlapply.
rrq
An rrq object
do.call
Behave like (but not via) do.call; given an element el, rather than run FUN(el) run FUN(el[[1]], el[[2]], ...).
group
Name of a group for generated task ids. If not included, an ID will be generated.
period
Period to poll for completed tasks. Affects how responsive the function is to quiting, mostly.
delete_tasks
Delete tasks on successful finish?
progress_bar
Display a progress bar?
env
Environment to look in

Description

Bulk queuing. Similar in some respects to things like apply. This is an experiment to deal with the pattern where you have a big pile of parameters in a data.frame to loop over, by applying a function to each row.

Details

There are two modes here; selected with do.call. With do.call=FALSE, the default, the function behaves similarly to apply(X, FUN, 1); that is the function is applied to each row of the data.frame (as a list): FUN(as.list(X[1,])), FUN(as.list(X[2,])), and so on. The alternative mode (do.call=TRUE) is where the data.frame contains parameters to the function FUN so equivalent to FUN(X[1,1], X[1,2], .... This is similar (but not implemented as) running: do.call("FUN", as.list(X[1,])).

Be careful, this one is going to change, including the name probably. You have been warned.