@@ -187,29 +187,8 @@ print.BatchtoolsFuture <- function(x, ...) {
187187}
188188
189189
190- status <- function (... ) UseMethod(" status" )
191- finished <- function (... ) UseMethod(" finished" )
192- loggedError <- function (... ) UseMethod(" loggedError" )
193- loggedOutput <- function (... ) UseMethod(" loggedOutput" )
194-
195- # ' Status of batchtools future
196- # '
197- # ' @param future The future.
198- # ' @param \ldots Not used.
199- # '
200- # ' @return A character vector or a logical scalar.
201- # '
202- # ' @aliases status finished result
203- # ' loggedError loggedOutput
204- # ' @keywords internal
205- # '
206- # ' @export
207- # ' @export status
208- # ' @export finished
209- # ' @export loggedError
210- # ' @export loggedOutput
211190# ' @importFrom batchtools getStatus
212- status.BatchtoolsFuture <- function (future , ... ) {
191+ status <- function (future , ... ) {
213192 debug <- getOption(" future.debug" , FALSE )
214193 if (debug ) {
215194 mdebug(" status() for " , class(future )[1 ], " ..." )
@@ -258,16 +237,32 @@ status.BatchtoolsFuture <- function(future, ...) {
258237}
259238
260239
261- # ' @export
262- # ' @keywords internal
263- finished.BatchtoolsFuture <- function (future , ... ) {
240+ finished <- function (future , ... ) {
264241 status <- status(future )
265242 if (is_na(status )) return (NA )
266243 any(c(" finished" , " error" , " expired" ) %in% status )
267244}
268245
269- # ' @export
246+
247+
248+ # ' Logged output of batchtools future
249+ # '
250+ # ' @param future The future.
251+ # ' @param \ldots Not used.
252+ # '
253+ # ' @return A character vector or a logical scalar.
254+ # '
255+ # ' @aliases loggedOutput loggedError
256+ # '
257+ # ' @export loggedError
258+ # ' @export loggedOutput
270259# ' @keywords internal
260+ loggedOutput <- function (... ) UseMethod(" loggedOutput" )
261+ loggedError <- function (... ) UseMethod(" loggedError" )
262+
263+
264+ # ' @importFrom batchtools getErrorMessages
265+ # ' @export
271266loggedError.BatchtoolsFuture <- function (future , ... ) {
272267 stat <- status(future )
273268 if (is_na(stat )) return (NULL )
@@ -294,7 +289,6 @@ loggedError.BatchtoolsFuture <- function(future, ...) {
294289
295290# ' @importFrom batchtools getLog
296291# ' @export
297- # ' @keywords internal
298292loggedOutput.BatchtoolsFuture <- function (future , ... ) {
299293 stat <- status(future )
300294 if (is_na(stat )) return (NULL )
@@ -502,29 +496,8 @@ run.BatchtoolsFuture <- function(future, ...) {
502496} # # run()
503497
504498
505- # ' Awaits the value of a batchtools future
506- # '
507- # ' @param future The future.
508- # ' @param cleanup If TRUE, the registry is completely removed upon
509- # ' success, otherwise not.
510- # ' @param timeout Total time (in seconds) waiting before generating an error.
511- # ' @param delta The number of seconds to wait between each poll.
512- # ' @param alpha A factor to scale up the waiting time in each iteration such
513- # ' that the waiting time in the k:th iteration is `alpha ^ k * delta`.
514- # ' @param \ldots Not used.
515- # '
516- # ' @return The value of the evaluated expression.
517- # ' If an error occurs, an informative Exception is thrown.
518- # '
519- # ' @details
520- # ' Note that `await()` should only be called once, because
521- # ' after being called the actual asynchronous future may be removed
522- # ' and will no longer available in subsequent calls. If called
523- # ' again, an error may be thrown.
524- # '
525- # ' @importFrom batchtools getErrorMessages loadResult waitForJobs
499+ # ' @importFrom batchtools loadResult waitForJobs
526500# ' @importFrom utils tail
527- # ' @keywords internal
528501await <- function (future , cleanup = TRUE ,
529502 timeout = getOption(" future.wait.timeout" , 30 * 24 * 60 * 60 ),
530503 delta = getOption(" future.wait.interval" , 1.0 ),
0 commit comments