-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
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
allow safe goroutine usage #100
Comments
Sorry for the very late response. Yeah, currently it is not safe to use the same golua.Runtime instance from multiple goroutines. It was not a design constraint, so I think it would be challenging to make it work in the most general case. |
At the very least, I want to run Lua event handlers asynchronously which I was able to do previously with gopher-lua. I also added a function in Lua that will run a callback in a goroutine. I liked how gopher-lua added stuff that allowed parallel Lua code in the style of Go, with a channel type, select function, goroutine safety, etc. |
Ok, would you be able to give me an example of API you would like to use? |
What do you mean? |
If you wrote an example of how you would like to write some code that achieves that you want. |
go func() {
rt.Call1(...)
}() Being able to call functions and run Lua code in multiple goroutines at the same time. |
Currently when using golua in multiple goroutines it may cause a panic. I noticed this when I was using an event emitter which emitted events async via gorouties which results in a lot of random errors (and panics) shown here:
The text was updated successfully, but these errors were encountered: