Skip to content

Latest commit

 

History

History
92 lines (63 loc) · 1.59 KB

File metadata and controls

92 lines (63 loc) · 1.59 KB

process

Summary

Manage coroutine-backed processes, inherited environment state, and owned handles.

Availability

  • Repository: opencomputers
  • System: openos
  • Type: library

Source

  • OpenComputers/src\main\resources\assets\opencomputers\loot\openos\lib\process.lua

Usage

local process = require("process")

API

process.addHandle(handle, proc)

  • Description: Register a handle under the current or specified process so it can be closed automatically on exit.
  • Parameters:
    • handle
    • proc
process.addHandle(nil, nil)

process.findProcess(co)

  • Description: Resolve a coroutine back to its owning process record.
  • Parameters:
    • co
process.findProcess(nil)

process.info(levelOrThread)

  • Description: Return process metadata such as path, environment, command name, and per-process data tables.
  • Parameters:
    • levelOrThread
process.info(nil)

process.load(path, env, init, name)

  • Description: Create a new coroutine-backed process from a script path or function.
  • Parameters:
    • path
    • env
    • init
    • name
process.load(nil, nil, nil, "value")

process.removeHandle(handle, proc)

  • Description: Remove a handle from a process handle list.
  • Parameters:
    • handle
    • proc
process.removeHandle(nil, nil)

process.running(level)

  • Description: Compatibility helper that returns the current process path, environment, and command name.
  • Parameters:
    • level
process.running(nil)

Notes

  • Only exported module functions are listed on this page.