We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In lack of a support channel (is there one?) I'm creating an issue for this.
Use case: Run a script, that calls a C# method, which runs DoStringAsync in the same state. This leads to "lua state is running" errors.
Current workaround: I copied the original dostring method from the library which parses the string and runs the compiler.
Is this the intended way to run nested dostrings, or are there alternatives?
The text was updated successfully, but these errors were encountered:
Ultimately it turned out to be a classic multithreading issue with a non-shareable resource, thus you need to lock it.
So in my Lua wrapper class I safeguard multiple awaited dostrings with a semaphore now:
private readonly SemaphoreSlim m_DoStringSemaphore = new(1, 1); public async Task<LuaValue[]> DoStringAsync(String script, String chunkName = null) { // semaphore to avoid "the lua state is currently running" InvalidOperationException await m_DoStringSemaphore.WaitAsync(); LuaValue[] result; try { result = await m_LuaState.DoStringAsync(script, chunkName); } finally { m_DoStringSemaphore.Release(); } return result; }
Works like a charm.
Still curious if there's a support channel with other users, Discord perhaps?
Sorry, something went wrong.
No branches or pull requests
In lack of a support channel (is there one?) I'm creating an issue for this.
Use case:
Run a script, that calls a C# method, which runs DoStringAsync in the same state. This leads to "lua state is running" errors.
Current workaround:
I copied the original dostring method from the library which parses the string and runs the compiler.
Is this the intended way to run nested dostrings, or are there alternatives?
The text was updated successfully, but these errors were encountered: