diff options
| author | ruki <[email protected]> | 2017-05-25 15:34:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-05-25 15:34:55 +0800 |
| commit | 3b730eeaa626c66ca38e66f4046e51e21d8a2204 (patch) | |
| tree | 0692ba690b6eaae8f28970c120c3bb65e0baa9ab /xmake/core/sandbox/modules/process.lua | |
| parent | 28a89ebabfaa2e1dc159591a65ab3af42d3e9152 (diff) | |
add process.runjobs
Diffstat (limited to 'xmake/core/sandbox/modules/process.lua')
| -rw-r--r-- | xmake/core/sandbox/modules/process.lua | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/xmake/core/sandbox/modules/process.lua b/xmake/core/sandbox/modules/process.lua index 619a3dfc6..e69a05e21 100644 --- a/xmake/core/sandbox/modules/process.lua +++ b/xmake/core/sandbox/modules/process.lua @@ -23,6 +23,7 @@ -- -- load modules +local process = require("base/process") local sandbox = require("sandbox/sandbox") local raise = require("sandbox/modules/raise") local vformat = require("sandbox/modules/vformat") @@ -127,6 +128,25 @@ function sandbox_process.waitlist(processes, timeout) return infos end +-- async run task and echo waiting info +function sandbox_process.asyncrun(task, waitchars) + + -- async run it + local ok, errors = process.asyncrun(task, waitchars) + if not ok then + raise(errors) + end +end + +-- run jobs with processes +function sandbox_process.runjobs(jobfunc, total, comax) + + -- run them + local ok, errors = process.runjobs(jobfunc, total, comax) + if not ok then + raise(errors) + end +end + -- return module return sandbox_process - |
