Conversation
commit: |
|
What is the cost of that encapsulation? |
Runner proxy is free (Proxy creation + a couple of function calls, completely free if you cache the If you choose to exclude argarray from this PR I can split it into another PR |
AriPerkkio
left a comment
There was a problem hiding this comment.
I'm not sure if this is something we want built-in into Tinypool, especially as there seems to be difference between runtime: 'worker_threads' and runtime: 'child_process' here. 🤔
Isn't this something that could be built on userland with small abstraction quite easily?
ec4cd7e to
30333bd
Compare
|
@AriPerkkio I've removed all the args code, now it's as simple as I could get it |
Runner proxy allows easily consume Typescript (and typed JS) modules the same way as if they would be imported as
import * as runnerAsync functions are typed the same, sync functions are mapped to async (this loses generics), non-functions are removed
worker_threadspool supports passing multiple arguments by usingObject.assign(argsArray, { __tinypool_args__: true }