-
Notifications
You must be signed in to change notification settings - Fork 12
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
fix: mark threads as experimental #49
Conversation
needsClose = false; | ||
await Promise.all([stdin.close(), stdout.close()]).catch(() => {}); | ||
}, | ||
fds: [stdin.fd, stdout.fd, stdout.fd], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deno, unlike Node, runs its "leaked file descriptor" check before the FinalizationRegistry
has a chance to fire; so we add the explicit close here.
let close = async () => { | ||
closeSync(stdin as any); | ||
closeSync(stdout as any); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... And Bun returns the wrong type from fs.promises.open
, so we guard against that here.
@@ -77,7 +77,8 @@ export async function createPlugin( | |||
opts.config ??= {}; | |||
opts.fetch ??= fetch; | |||
|
|||
opts.runInWorker ??= CAPABILITIES.hasWorkerCapability; | |||
// TODO(chrisdickinson): reset this to `CAPABILITIES.hasWorkerCapability` once we've fixed https://github.com/extism/js-sdk/issues/46. | |||
opts.runInWorker ??= false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(It's a blink-and-you'll-miss-it diff – this is what actually changes the default threading behavior of the plugin.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Is there somewhere we can document this? Either in the readme or the ref doc.
It should show up in the ref docs as experimental thanks to the |
Because we're still working out kinks in the implementation [1], users can specifically request that plugins run in the background, but they no longer do so by default where available. Once [1] is fixed, we're likely to make threading default again. [1]: #46
d90f062
to
e09566a
Compare
(On re-read, it's not clear that we've backed it out waiting on a bugfix; I've updated the ref doc with a link to the bug!) |
Because we're still working out kinks in the implementation 1, users can specifically request that plugins run in the background, but they no longer do so by default where available. Once 1 is fixed, we're likely to make threading default again.