Closed kaneplusplus closed 4 years ago
Thank you for the PR.
I remember that I had something like this, but then set the workers to NA because of an issue with it (that I can't remember right now).
I'll do some more testing and see how this works!
The return of
foreach::getDoParWorkers()
is often used to decide how to partition data structures that are going to be processed in parallel. Ifn_jobs
is set inregister_dopar_cmq
, then the number of jobs should be made available through theforeach
package. Currently, it always returnsNA
.Admittedly, there is a slight distinction between the number of workers and the number of jobs sent to a queue. However, I don't think it'll be an issue in practice and it would maintain orthogonality between foreach and it's backend.
I can sent a pull request later today.