This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
api:process [2015/03/10 15:32] alexbuzzbee Added process.info() |
api:process [2016/02/29 09:26] payonel [Process API] |
||
---|---|---|---|
Line 2: | Line 2: | ||
========== | ========== | ||
This API provides rudimentary process management. It is used mainly by the `io` module to provide individual standard input and output to individual programs. | This API provides rudimentary process management. It is used mainly by the `io` module to provide individual standard input and output to individual programs. | ||
+ | |||
+ | It can be helpful to think of a process as a coroutine with extra metadata. A process inherits the metadata of its parent, but can define its own. Such metadata supports stdio and terminal windows. All coroutines created are child instances of the current process. | ||
- `process.load(path:string[, env:table[, init:function[, name:string]]]):coroutine` | - `process.load(path:string[, env:table[, init:function[, name:string]]]):coroutine` | ||
Line 14: | Line 16: | ||
The second returned value is the environment of the process, i.e. the table created for it to use as one. | The second returned value is the environment of the process, i.e. the table created for it to use as one. | ||
The third returned value is the 'name' of the process, i.e. the fourth parameter to `process.load`. For programs started via the shell this will ususally be the original command. E.g. for `ls -l`, the first returned value will be `ls`, while this value will be `ls -l`. | The third returned value is the 'name' of the process, i.e. the fourth parameter to `process.load`. For programs started via the shell this will ususally be the original command. E.g. for `ls -l`, the first returned value will be `ls`, while this value will be `ls -l`. | ||
- | | + | |
Contents | Contents | ||
----------- | ----------- | ||
{{page>api:contents&noheader&noeditbutton&nouser&nofooter}} | {{page>api:contents&noheader&noeditbutton&nouser&nofooter}} |