WardrikLua. Sandbox. Limits
(wardrik_lua v0.1.0-rc.1)
Copy Markdown
Bounds for one evaluation.
WardrikLua.Sandbox.Limits.new(timeout_ms: :timer.seconds(5), max_steps: 1_000_000)| Field | Default | Bounds |
|---|---|---|
:timeout_ms | 30s | how long the evaluation may run |
:max_heap_bytes | 64 MB | memory the evaluating process may hold |
:max_steps | 10M | operations the code may execute |
:max_depth | 200 | nested calls the code may make |
Set any field to :infinity to lift that limit.
Summary
Functions
Returns limits, with defaults for fields not given.
Types
@type limit() :: pos_integer() | :infinity
A bound, or :infinity for none.
@type t() :: %WardrikLua.Sandbox.Limits{ max_depth: limit(), max_heap_bytes: limit(), max_steps: limit(), timeout_ms: limit() }
Bounds for one evaluation.
Functions
Returns limits, with defaults for fields not given.
Raises KeyError on an unknown field, and ArgumentError on a bound that isn't a positive
integer or :infinity.