pinnacle/api/lua/doc/process.lua

30 lines
1.5 KiB
Lua
Raw Normal View History

2023-08-01 18:06:35 +02:00
-- SPDX-License-Identifier: GPL-3.0-or-later
2023-07-23 00:43:36 +02:00
---This file houses LDoc documentation with dummy functions.---
---Process management
---@module ProcessModule
local process_module = {}
---Spawn a process with an optional callback for its stdout, stderr, and exit information.
---
---`callback` has the following parameters:<br>
--- - `stdout` - The process's stdout printed this line.<br>
--- - `stderr` - The process's stderr printed this line.<br>
--- - `exit_code` - The process exited with this code.<br>
--- - `exit_msg` - The process exited with this message.<br>
---@tparam string|string[] command The command as one whole string or a table of each of its arguments
---@tparam function callback A callback to do something whenever the process's stdout or stderr print a line, or when the process exits.
function process_module.spawn(command, callback) end
---Spawn a process only if it isn't already running, with an optional callback for its stdout, stderr, and exit information.
---
---`callback` has the following parameters:<br>
--- - `stdout` - The process's stdout printed this line.<br>
--- - `stderr` - The process's stderr printed this line.<br>
--- - `exit_code` - The process exited with this code.<br>
--- - `exit_msg` - The process exited with this message.<br>
---@tparam string|string[] command The command as one whole string or a table of each of its arguments
---@tparam function callback A callback to do something whenever the process's stdout or stderr print a line, or when the process exits.
function process_module.spawn_once(command, callback) end