-
Notifications
You must be signed in to change notification settings - Fork 9
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
Release? #3
Comments
@yovanoc Hi, thanks for your interest in the library. Unfortunately, the lib is pending a rebuild and isn't in a publishable state. I plan to revisit sometime later next year (most of the work involves removing the decorators and opting for the interface you see in the readme). Also I'd like to explore getting this library to work across Node, Deno and the Web Browser (ESM). But to support all environments, some of the internals need to change, so this is deferred for the time being. The current published version should work fine on Node in the interim (the functionality isn't changing in the planned update, however the Apologies for the inconvenience. |
Oh right I get it but it's not working with nodejs and esm for me with decorators. I get this strange error:
workspace is a turborepo. but I really don't know why is looking for a project.js, and its only when I add the @main decorator. Is there any other way for now? |
@sinclairzx81 You will never come back to this lib? thanks |
@yovanoc Hi, Um, I may return to this project one day. Unfortunately, I had made some attempts to get this project working with Node, Deno, Bun and the Web Browser (with not much success). I could simply push on with this project being exclusive to Node, but not entirely sure if it's worthwhile (also, the mechanisms used by this project seem at odds with "top-level-await", and typical JavaScript idioms) I guess I could proceed with this project so long as users are fine with import { Thread } from '@sinclair/threadbox'
import * as Http from 'node:http'
Thread.Main(() => {
// ensure all top level code is wrapped within a Main callback.
Http.createServer(() => { ... }).listen(1234)
}) Thoughts? |
I think if we can await import in the callback it should cover all cases |
@yovanoc Heya,
There might be some caveats to that, not sure. The way this system works is each "threaded" class needs to be registered and (re-registered) for each thread you spawn. The system tracks an So, this works for standard imports, but There was a couple of things I wanted to add to this library (specifically static/global threads), but don't currently have the time to implement. If there's demand for a library like this, it would be somewhat more compelling however. Did you have a use case in mind? |
Can you do a release with the latest changes please?
The text was updated successfully, but these errors were encountered: