Closed boaz-chen closed 4 months ago
Thank you for the bug report! It was a bug in mlua and users are not allowed to reset running coroutines (it's not supported by Lua itself).
Answering your question. To stop executing Lua script you can simply return a error from the hook and coroutine will finish immediately with the returned error.
Thanks. This is working perfectly.
First off, thank you for creating and maintaining this wonderful crate!
I'm trying to limit the time a script executes, and what I found to be potentially the most effective way was to set a hook that will reset the thread if the execution time is too long (I would be more than happy to hear about better ways to achieve that).
While experimenting with that, I hit an internal bug that needed to be reported.
Here's hopefully the shortest repro for it:
Output:
Thanks!