Closed ShadowMarker789 closed 2 years ago
I have just now realized that there is already issue #106 https://github.com/neolithos/neolua/issues/106 which for some reason did not come up when I searched "cancel" nor "abort"
I descriped, a way to do this without changing the lua-script-code it self.
This is a strong, but really handy sword.
NeoLua Version: 1.3.13 from Nuget
Example to reproduce:
If I'm letting users type in their own code and execute it, I need some way to 'cancel' the code execution.
I'm not able to see any methods that take in cancellation tokens or similar ways to stop execution.
As fun as it would be to abort the thread I have been told not to do this.
Also as fun as it would be to let users write while-true loops it's also a problem.
I could do it on another thread, but if we're wanting to manipulate UI elements the manipulations have to be executed on the WPF Dispatcher thread in the first place. That also doesn't solve the issue of having a Lua chunk spinning forever.
What do you think? I'm really enjoying NeoLua so far, it's fantastic.