future.batchtools icon indicating copy to clipboard operation
future.batchtools copied to clipboard

Compatibility with promises package

Open michaelmayer2 opened this issue 4 years ago • 0 comments

Describe the bug When used with promises package, future.batchtools complains about a missing option "background" to nbrOfWorkers() and secondly about a missing function nbrOfFreeWorkers()

Error Message Unhandled promise error: nbrOfFreeWorkers() is not implemented for this type of future backend (please contacts the maintainer of that backend): ‘FutureStrategy’, ‘tweaked’, ‘batchtools_slurm’, ‘batchtools_template’, ‘batchtools’, ‘multiprocess’, ‘future’, ‘function’

Expected behavior No error displayed

When using the attached patch against latest future.batchtools from github fixes the issue.

I am not sure if my approach of duplicating nbrOfWorkers() and renaming it to nbrOfWorkers(), additionally adding background as a dummy argument to both is sensible, at least the promises integration is working with this patch (see below).

promises-compat.diff.txt

michaelmayer2 avatar Jan 21 '22 14:01 michaelmayer2