Idea
Similar to how luaerl has this has a way of specifying max reductions, it'd be neat to have that ability to limit both the max reductions (in BEAM-land) or the max lua bytecode instructions.
This would be helpful when sandboxing user code that might be poorly-behaved or which we want to more carefully timeshare.
Suggestions
- Add optional
max_reductions or max_instructions keys to Lua.eval!'s options param.
- Change the return values in such cases:
{:done, ...returned values..., ...returned state...} or {:exceeded_reductions, ...returned state...} or {:exceeded_instructions, ...returned state...}
Prior art
Idea
Similar to how luaerl has this has a way of specifying max reductions, it'd be neat to have that ability to limit both the max reductions (in BEAM-land) or the max lua bytecode instructions.
This would be helpful when sandboxing user code that might be poorly-behaved or which we want to more carefully timeshare.
Suggestions
max_reductionsormax_instructionskeys toLua.eval!'soptionsparam.{:done, ...returned values..., ...returned state...}or{:exceeded_reductions, ...returned state...}or{:exceeded_instructions, ...returned state...}Prior art