Merge branch 'master' into feature/task-functions
[poolifier.git] / docs / api.md
index df7d1ce5c1fa63def41ccbedbd1522f19c350aca..15760676c1f23e38518a5f19cece8f03308f5b05 100644 (file)
@@ -8,7 +8,7 @@
   - [`pool.execute(data, name, transferList)`](#poolexecutedata-name-transferlist)
   - [`pool.start()`](#poolstart)
   - [`pool.destroy()`](#pooldestroy)
-  - [`pool.listTaskFunctions()`](#poollisttaskfunctions)
+  - [`pool.listTaskFunctionNames()`](#poollisttaskfunctionnames)
   - [`PoolOptions`](#pooloptions)
     - [`ThreadPoolOptions extends PoolOptions`](#threadpooloptions-extends-pooloptions)
     - [`ClusterPoolOptions extends PoolOptions`](#clusterpooloptions-extends-pooloptions)
@@ -17,7 +17,7 @@
     - [`YourWorker.hasTaskFunction(name)`](#yourworkerhastaskfunctionname)
     - [`YourWorker.addTaskFunction(name, fn)`](#yourworkeraddtaskfunctionname-fn)
     - [`YourWorker.removeTaskFunction(name)`](#yourworkerremovetaskfunctionname)
-    - [`YourWorker.listTaskFunctions()`](#yourworkerlisttaskfunctions)
+    - [`YourWorker.listTaskFunctionNames()`](#yourworkerlisttaskfunctionnames)
     - [`YourWorker.setDefaultTaskFunction(name)`](#yourworkersetdefaulttaskfunctionname)
 
 ## Pool
@@ -51,7 +51,13 @@ This method is available on both pool implementations and will start the minimum
 
 This method is available on both pool implementations and will call the terminate method on each worker.
 
-### `pool.listTaskFunctions()`
+### `pool.hasTaskFunction(name)`
+
+`name` (mandatory) The task function name
+
+This method is available on both pool implementations and returns a boolean.
+
+### `pool.listTaskFunctionNames()`
 
 This method is available on both pool implementations and returns an array of the task function names.
 
@@ -148,22 +154,22 @@ An object with these properties:
 
 `name` (mandatory) The task function name.
 
-This method is available on both worker implementations and returns a boolean.
+This method is available on both worker implementations and returns `{ status: boolean, error?: Error }`.
 
 #### `YourWorker.addTaskFunction(name, fn)`
 
 `name` (mandatory) The task function name.  
 `fn` (mandatory) The task function.
 
-This method is available on both worker implementations and returns a boolean.
+This method is available on both worker implementations and returns `{ status: boolean, error?: Error }`.
 
 #### `YourWorker.removeTaskFunction(name)`
 
 `name` (mandatory) The task function name.
 
-This method is available on both worker implementations and returns a boolean.
+This method is available on both worker implementations and returns `{ status: boolean, error?: Error }`.
 
-#### `YourWorker.listTaskFunctions()`
+#### `YourWorker.listTaskFunctionNames()`
 
 This method is available on both worker implementations and returns an array of the task function names.
 
@@ -171,4 +177,4 @@ This method is available on both worker implementations and returns an array of
 
 `name` (mandatory) The task function name.
 
-This method is available on both worker implementations and returns a boolean.
+This method is available on both worker implementations and returns `{ status: boolean, error?: Error }`.