Use defaut nil callback for execProcesses
This commit is contained in:
parent
2f3add99bb
commit
49e9332661
1 changed files with 1 additions and 11 deletions
|
|
@ -236,7 +236,7 @@ proc countProcessors*(): int {.rtl, extern: "nosp$1".} =
|
||||||
proc execProcesses*(cmds: openArray[string],
|
proc execProcesses*(cmds: openArray[string],
|
||||||
options = {poStdErrToStdOut, poParentStreams},
|
options = {poStdErrToStdOut, poParentStreams},
|
||||||
n = countProcessors(),
|
n = countProcessors(),
|
||||||
beforeRunEvent: proc(idx: int)): int
|
beforeRunEvent: proc(idx: int) = nil): int
|
||||||
{.rtl, tags: [ExecIOEffect, TimeEffect, ReadEnvEffect, RootEffect]} =
|
{.rtl, tags: [ExecIOEffect, TimeEffect, ReadEnvEffect, RootEffect]} =
|
||||||
## executes the commands `cmds` in parallel. Creates `n` processes
|
## executes the commands `cmds` in parallel. Creates `n` processes
|
||||||
## that execute in parallel. The highest return value of all processes
|
## that execute in parallel. The highest return value of all processes
|
||||||
|
|
@ -295,16 +295,6 @@ proc execProcesses*(cmds: openArray[string],
|
||||||
result = max(waitForExit(p), result)
|
result = max(waitForExit(p), result)
|
||||||
close(p)
|
close(p)
|
||||||
|
|
||||||
proc execProcesses*(cmds: openArray[string],
|
|
||||||
options = {poStdErrToStdOut, poParentStreams},
|
|
||||||
n = countProcessors()): int
|
|
||||||
{.rtl, extern: "nosp$1",
|
|
||||||
tags: [ExecIOEffect, TimeEffect, ReadEnvEffect, RootEffect]} =
|
|
||||||
## executes the commands `cmds` in parallel. Creates `n` processes
|
|
||||||
## that execute in parallel. The highest return value of all processes
|
|
||||||
## is returned.
|
|
||||||
return execProcesses(cmds, options, n, nil)
|
|
||||||
|
|
||||||
proc select*(readfds: var seq[Process], timeout = 500): int
|
proc select*(readfds: var seq[Process], timeout = 500): int
|
||||||
## `select` with a sensible Nim interface. `timeout` is in miliseconds.
|
## `select` with a sensible Nim interface. `timeout` is in miliseconds.
|
||||||
## Specify -1 for no timeout. Returns the number of processes that are
|
## Specify -1 for no timeout. Returns the number of processes that are
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue