Skip to content

Class pinnacle.process

Process management.

This module provides utilities to spawn processes and capture their output.

Functions

function spawn

function pinnacle.process.spawn(...: string)
    -> pinnacle.process.Child?

Spawns a process, returning a Child with the process's standard IO if successful.

Receives the arguments of the command to be spawned, either as varargs or as a table.

For more control over the spawn, use Process.command instead.

Parameters

...: string - The arguments of the command.

Returns

  1. pinnacle.process.Child - A child with the process's standard IO, or nil if the process failed to spawn or doesn't exist.

See also

function spawn_once

function pinnacle.process.spawn_once(...: string)
    -> pinnacle.process.Child?

Spawns a process if it hasn't been spawned before, returning a Child with the process's standard IO if successful.

Receives the arguments of the command to be spawned, either as varargs or as a table.

For more control over the spawn, use Process.command instead.

Parameters

...: string - The arguments of the command.

Returns

  1. pinnacle.process.Child - A child with the process's standard IO, or nil if the process failed to spawn or doesn't exist.

See also

function spawn_unique

function pinnacle.process.spawn_unique(...: string)
    -> pinnacle.process.Child?

Spawns a process if it isn't already running, returning a Child with the process's standard IO if successful.

Receives the arguments of the command to be spawned, either as varargs or as a table.

For more control over the spawn, use Process.command instead.

Parameters

...: string - The arguments of the command.

Returns

  1. pinnacle.process.Child - A child with the process's standard IO, or nil if the process failed to spawn or doesn't exist.

See also

function command

function pinnacle.process.command(cmd: pinnacle.process.CommandOpts)
    -> pinnacle.process.Command

Creates a Command from the given options.

A Command represents a to-be-spawned process.

Parameters

cmd: pinnacle.process.CommandOpts - Options for the command.

Returns

  1. pinnacle.process.Command - An object that allows you to spawn this command.

Last updated: