Closed larshp closed 5 years ago
The main example is intended to show how microjob works: just define a function with a heavy CPU load so it will be executed in a separated thread. This is the purpose of microjob: simplicity. Your example could be useful to show how the underneath worker pool works.
Instead, I suggest to create an examples
folder, both for JS and TS, full of useful examples.
I've added the examples
folder: I consider this issue closed.
Feel free to re-open again if you think it does not satisfy your type of CPU bound examples.
Hi, The Sync example runs in a different thread as described, and I did not succeed getting the async example working. However, it looks like both examples are not limited by CPU, suggest adding an example which utilites all cores.
Following is what I've come up with: