That means it will execute only one set of instruction at any time in same process.
nothing that required the complexity of multithreading.
Node runs on a single thread, and there is just one process happening at a time in the event loop.
One code, one execution, (the code is not executed in parallel).
There is a downside single threading
that code can block the event loop and prevent other requests of being handled.
I have created one worker file which will create one worker thread to execute particular code on separate thread.
This worker file is create one worker which will execute on another thread.
We have to create both files as worker_threads only excepts js or jsx files
Add your code in migration.ts file which you want to execute on different thread.
Now you have to just call runWorker method from worker.ts file which will execute your code in migration.ts file.
Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.