Merge branch 'master' into add-worker-test
[poolifier.git] / src / pools / pool.ts
index 55e15792b01f23a4305e42f3d4fe4689e7dbaf05..f96e5c0cbff3ed84afe5d06c6ac8f2097539ba9f 100644 (file)
@@ -5,10 +5,6 @@
  * @template Response Type of response of execution.
  */
 export interface IPool<Data = unknown, Response = unknown> {
-  /**
-   * Shut down every current worker in this pool.
-   */
-  destroy(): Promise<void>
   /**
    * Perform the task specified in the constructor with the data parameter.
    *
@@ -16,4 +12,8 @@ export interface IPool<Data = unknown, Response = unknown> {
    * @returns Promise that will be resolved when the task is successfully completed.
    */
   execute(data: Data): Promise<Response>
+  /**
+   * Shut down every current worker in this pool.
+   */
+  destroy(): Promise<void>
 }