Andy Wermke
Andy Wermke
Interesting idea! Now we are pretty much getting to the point where all the `expose()`, `Transferable()`, `Callback()`, ... things basically justify an abstract message passing API package of their own...
I was able to put something together on a feature branch: [`feature/callbacks`](https://github.com/andywer/threads.js/commits/feature/callbacks) Turned out to make a major refactoring necessary, but it allows the master thread to pass callbacks to...
@philkunz `Callback` is just a function returning another function spiced up with some extra properties. There is no instantiation of any class 😉
> So does that mean `await worker("http://fetch.this/then/filter", () => { console.log('hey there') })` would also work? Nope, you need to use `Callback()` to mark the function as a callback and...
Hmm… I see what you guys mean, but for me such a basic feature feels like it should have a short, catchy name as you're likely gonna use it a...
@simplecommerce Interesting question. I guess it would. My intention with that feature was to make the whole setup more generic, allowing you to implement async iterators between threads or event...
Thanks for sharing, @TrashUwU. Don't see any mistakes on your end so far. The max event listeners warning is annoying and should be fixed, but should be uncritical. I will...
Btw, we can rule out that the workers just get slower once the work starts piling up? Also… how much degradation of performance are we talking about here?
Hey @jasonk. Thanks a lot for raising the issue! To be precise, we only set those signal handlers in the worker threads, never in the main thread. Sure, without a...
IDK if this is the most elegant way to solve it, but my first idea was something alone these lines… ```js // worker.js import { expose, preventDefaultSignalHandlers } from "threads/worker";...