Skip to content
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

Make Handlebars::Context.current thread safe #46

Closed
wants to merge 1 commit into from

Conversation

mpeychich
Copy link

@mpeychich mpeychich commented May 9, 2017

Handlebars::Template#call was mutating global state. When called in
multiple threads you ran the risk of overwriting the current context for
other threads while the @fn.call was executing. By moving to a thread
variable we ensure that this value remains with the thread which is
setting the value.

Also in this PR are some dependency updates including requiring a modern
ruby. All three ruby versions previously tested are no longer
maintained.

Should address #39

Handlebars::Template#call was mutating global state. When called in
multiple threads you ran the risk of overwriting the current context for
other threads while the @fn.call was executing. By moving to a thread
variable we ensure that this value remains with the thread which is
setting the value.

Also in this PR are some dependency updates including requiring a modern
ruby. All three ruby versions previously tested are no longer
maintained.
@mpeychich
Copy link
Author

@cowboyd Any thoughts on this? I'd love to get this merged in. I am not familiar with the versioning change needed here since it does bump the required ruby version, but it does so by requiring the minimum maintained version (lower than that even) where there was no minimum previously.

@tombeynon tombeynon mentioned this pull request Jun 9, 2020
@mpeychich mpeychich closed this Mar 22, 2022
@mpeychich mpeychich deleted the thread-safe-context branch March 22, 2022 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant