Skip to content

Commit

Permalink
add verbose flag (closes #61)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschubert committed Nov 29, 2017
1 parent 449695a commit 8f2677d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/qsys_multicore.r
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MULTICORE = R6::R6Class("MULTICORE",
# fun = clustermq:::worker,
# master = values$master)

cmd = quote(clustermq:::worker(private$master))
cmd = quote(clustermq:::worker(private$master, verbose=FALSE))
for (i in seq_len(n_jobs)) {
p = parallel::mcparallel(cmd, silent=TRUE, detached=TRUE)
private$pids = c(private$pids, p$pid)
Expand Down
6 changes: 5 additions & 1 deletion R/worker.r
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
#' @param master The master address (tcp://ip:port)
#' @param timeout Time until worker shuts down without hearing from master
#' @param ... Catch-all to not break older template values (ignored)
worker = function(master, timeout=600, ...) {
#' @param verbose Whether to print debug messages
worker = function(master, timeout=600, ..., verbose=TRUE) {
if (!verbose)
message = function(...) invisible(NULL)

message("Master: ", master)
if (length(list(...)) > 0)
warning("Arguments ignored: ", paste(names(list(...)), collapse=", "))
Expand Down

0 comments on commit 8f2677d

Please sign in to comment.