fix: properly handle response for add/remove/set task function operaions
[poolifier.git] / src / pools / pool.ts
index 6156a0421170e6baa8ad7c2071b755da554a03ed..a19b70a387665bf13d8c7f796390928da52ed0d8 100644 (file)
@@ -252,14 +252,14 @@ export interface IPool<
   readonly addTaskFunction: (
     name: string,
     taskFunction: TaskFunction
-  ) => boolean
+  ) => Promise<boolean>
   /**
    * Removes a task function from this pool.
    *
    * @param name - The name of the task function.
    * @returns `true` if the task function was removed, `false` otherwise.
    */
-  readonly removeTaskFunction: (name: string) => boolean
+  readonly removeTaskFunction: (name: string) => Promise<boolean>
   /**
    * Lists the names of task function available in this pool.
    *
@@ -272,7 +272,7 @@ export interface IPool<
    * @param name - The name of the task function.
    * @returns `true` if the default task function was set, `false` otherwise.
    */
-  readonly setDefaultTaskFunction: (name: string) => boolean
+  readonly setDefaultTaskFunction: (name: string) => Promise<boolean>
   /**
    * Sets the worker choice strategy in this pool.
    *