feat: add transferable objects support to worker_threads pool
[poolifier.git] / docs / api.md
index 6f66d038c1db08c7936f8edb1630b41d53a8460d..9662c29830f0f7e8c799029d2d4d2ada207d9f8f 100644 (file)
@@ -5,7 +5,7 @@
 - [Pool](#pool)
   - [`pool = new FixedThreadPool/FixedClusterPool(numberOfThreads/numberOfWorkers, filePath, opts)`](#pool--new-fixedthreadpoolfixedclusterpoolnumberofthreadsnumberofworkers-filepath-opts)
   - [`pool = new DynamicThreadPool/DynamicClusterPool(min, max, filePath, opts)`](#pool--new-dynamicthreadpooldynamicclusterpoolmin-max-filepath-opts)
-  - [`pool.execute(data, name)`](#poolexecutedata-name)
+  - [`pool.execute(data, name, transferList)`](#poolexecutedata-name-transferlist)
   - [`pool.destroy()`](#pooldestroy)
   - [`PoolOptions`](#pooloptions)
     - [`ThreadPoolOptions extends PoolOptions`](#threadpooloptions-extends-pooloptions)
 `filePath` (mandatory) Path to a file with a worker implementation  
 `opts` (optional) An object with the pool options properties described below
 
-### `pool.execute(data, name)`
+### `pool.execute(data, name, transferList)`
 
 `data` (optional) An object that you want to pass to your worker implementation  
 `name` (optional) A string with the task function name that you want to execute on the worker. Default: `'default'`
+`transferList` (optional) An array of transferable objects that you want to transfer to your [worker_threads](https://nodejs.org/api/worker_threads.html) worker implementation
 
 This method is available on both pool implementations and returns a promise with the task function execution response.