Thread Pools
Introduction
Provision is provided for multi-threading in Dynamo using webworker-threads. This allows creation of asynchronous functions that run outside of the singular thread running the event loop and other node.js functions. It enables the creation of non-blocking CPU-bound I/O operations.
Overview
The threadpool object is exposed on the Infrastructure object and can be accessed using
this.entityRepo.infrastructure().threadPool;
Calling the run
method of this object and passing the context, function to execute, and a callback function. The definition for this function is given as -
this.entityRepo.infrastructure().threadPool.run = function (
context,
fn,
callback
) {};