Process
Edit on GitHubUtilities for accessing functionality and information about the Grain program’s process.
This includes things like accessing environment variables and sending signals.
Types
Type declarations included in the Process module.
Process.Signal
Signals that can be sent to the host system.
Values
Functions and constants included in the Process module.
Process.argv
Access command line arguments.
Returns:
type | description |
---|---|
Result<Array<String>, Exception> |
Ok(args) of an array containing positional string arguments to the process if successful or Err(exception) otherwise |
Process.env
Access environment variables.
Returns:
type | description |
---|---|
Result<Array<String>, Exception> |
Ok(vars) of an array containing environment variables supplied to the process if successful or Err(exception) otherwise |
Process.exit
Terminate the process normally.
Parameters:
param | type | description |
---|---|---|
code |
Number |
The value to exit with. An exit code of 0 is considered normal, with other values having meaning depending on the platform |
Returns:
type | description |
---|---|
Result<Void, Exception> |
Err(exception) if unsuccessful. Will not actually return a value if successful, as the process has ended |
Process.sigRaise
Send a signal to the process of the calling thread.
Parameters:
param | type | description |
---|---|---|
signal |
Signal |
The signal to send |
Returns:
type | description |
---|---|
Result<Void, Exception> |
Ok(void) if successful or Err(exception) otherwise |
Process.schedYield
Yield execution to the calling thread.
Returns:
type | description |
---|---|
Result<Void, Exception> |
Ok(void) if successful or Err(exception) otherwise |