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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(atomics): add environment variable to disable atomics #163

Merged
merged 3 commits into from
Dec 9, 2021

Conversation

SamVerschueren
Copy link
Contributor

Hi 馃憢 !

As discussed privately, it would be nice for runtimes to disable the use of Atomics globally as it does not change the outcome at all. A runtime like WebContainer runs in the browser and is currently not capable of implementing receiveMessageOnPort as the browser does not have such implementation.

By adding this environment variable, we are capable of turning it off in general and make piscina work out-of-the-box in StackBlitz WebContainers.

Feel free to suggest different wording for the readme.

Sam

package-lock.json Outdated Show resolved Hide resolved
jasnell
jasnell previously approved these changes Dec 6, 2021
@SamVerschueren
Copy link
Contributor Author

I've also replaced eval() with new Function() as that's the preferred way of evaluating as explained in the Never use eval! section.

d3lm
d3lm previously approved these changes Dec 7, 2021
jasnell
jasnell previously approved these changes Dec 7, 2021
@SamVerschueren SamVerschueren dismissed stale reviews from jasnell and d3lm via 02893a5 December 7, 2021 13:54
@SamVerschueren
Copy link
Contributor Author

Sorry. I just saw that I had to disable a lint rule for the new Function(). Fixed it and verified that linting is now correct.

@jasnell jasnell merged commit b6dbbf1 into piscinajs:current Dec 9, 2021
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

3 participants