-
Notifications
You must be signed in to change notification settings - Fork 67
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
Threadsafe usage #51
Comments
Attempting this implementation I get:
I suppose I'll have to read up more on the ruby threading. 🤷♂️ I've been impacted by this issue for a few years now. |
askcharlie has your implementation. I'll give it a go. https://github.com/askcharlie/handlebars.rb/commit/f8259b4770f74fdcd3e3d21b7fc492b6b1380130 |
Revisiting this problem, still, hangs. Its a bummer a pure ruby implementation doesn't match the syntax found in this gem. |
This looks like it's working. However, it seems like there's some memory leak when we're doing it this way as we are registering some handlebar methods |
We were having a lot of issues with this gem causing hanging behaviour in a multi-threaded environment. V8 is the downstream cause of this behaviour.
We looked at #46 to try to solve it, but that PR exhibited similar issues.
We ended up solving by using a Singleton class to manage a mutex whenever you want to compile a template. An example below in case anyone else hits the same problem:
The text was updated successfully, but these errors were encountered: