docs(process): document managed process workflows
All checks were successful
Linux unit tests / unit-tests (push) Successful in 48s
All checks were successful
Linux unit tests / unit-tests (push) Successful in 48s
This commit is contained in:
16
README.md
16
README.md
@@ -10,7 +10,7 @@ one consistent API on Windows and Linux.
|
|||||||
- UTF-8 text, file-list, and RGBA image clipboard access
|
- UTF-8 text, file-list, and RGBA image clipboard access
|
||||||
- Native desktop notifications
|
- Native desktop notifications
|
||||||
- Standard application, user, temporary, and executable paths
|
- Standard application, user, temporary, and executable paths
|
||||||
- Non-blocking process launch
|
- Managed and blocking processes with pipes, timeouts, and output capture
|
||||||
- Move-only dynamic library handles with automatic cleanup
|
- Move-only dynamic library handles with automatic cleanup
|
||||||
- Environment variables and basic system information
|
- Environment variables and basic system information
|
||||||
- Monotonic timing and sleeping
|
- Monotonic timing and sleeping
|
||||||
@@ -97,8 +97,18 @@ auto config = izo::GetKnownPath(izo::KnownPath::Config);
|
|||||||
izo::ProcessOptions process;
|
izo::ProcessOptions process;
|
||||||
process.executable = "tool";
|
process.executable = "tool";
|
||||||
process.arguments = {"--input", "asset.png"};
|
process.arguments = {"--input", "asset.png"};
|
||||||
if (auto launched = izo::LaunchProcess(process)) {
|
process.captureOutput = true;
|
||||||
// launched.processId identifies the new process.
|
process.timeoutMs = 5000;
|
||||||
|
const auto completed = izo::RunProcess(process);
|
||||||
|
if (completed.exitCode == 0) {
|
||||||
|
// completed.stdoutText contains the tool output.
|
||||||
|
}
|
||||||
|
|
||||||
|
process.pipeStdin = true;
|
||||||
|
if (auto running = izo::StartProcess(process)) {
|
||||||
|
running.WriteStdin("input");
|
||||||
|
running.CloseStdin();
|
||||||
|
running.Wait();
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user