PtcRunner.Sandbox (PtcRunner v0.2.0)
View SourceExecutes programs in isolated BEAM processes with resource limits.
Spawns isolated processes with configurable timeout and memory limits, ensuring safe program execution.
Summary
Functions
Executes an AST in an isolated sandbox process.
Types
Functions
@spec execute(map(), PtcRunner.Context.t(), keyword()) :: {:ok, any(), metrics()} | {:error, {atom(), non_neg_integer()} | {atom(), String.t()}}
Executes an AST in an isolated sandbox process.
Arguments
- ast: The AST to execute
- context: The execution context
- opts: Options (timeout, max_heap)
Returns
{:ok, result, metrics}on success{:error, reason}on failure