+ readonly clearTasksQueue: () => void
+ /**
+ * Whether the worker node has back pressure (i.e. its tasks queue is full).
+ *
+ * @returns `true` if the worker node has back pressure, `false` otherwise.
+ */
+ readonly hasBackPressure: () => boolean
+ /**
+ * Terminates the worker node.
+ */
+ readonly terminate: () => Promise<void>
+ /**
+ * Registers a worker event handler.
+ *
+ * @param event - The event.
+ * @param handler - The event handler.
+ */
+ readonly registerWorkerEventHandler: (
+ event: string,
+ handler: EventHandler<Worker>
+ ) => void
+ /**
+ * Registers once a worker event handler.
+ *
+ * @param event - The event.
+ * @param handler - The event handler.
+ */
+ readonly registerOnceWorkerEventHandler: (
+ event: string,
+ handler: EventHandler<Worker>
+ ) => void
+ /**
+ * Gets task function worker usage statistics.
+ *
+ * @param name - The task function name.
+ * @returns The task function worker usage statistics if the task function worker usage statistics are initialized, `undefined` otherwise.
+ */
+ readonly getTaskFunctionWorkerUsage: (name: string) => WorkerUsage | undefined
+ /**
+ * Deletes task function worker usage statistics.
+ *
+ * @param name - The task function name.
+ * @returns `true` if the task function worker usage statistics were deleted, `false` otherwise.
+ */
+ readonly deleteTaskFunctionWorkerUsage: (name: string) => boolean
+}
+
+/**
+ * Worker node event detail.
+ *
+ * @internal
+ */
+export interface WorkerNodeEventDetail {
+ workerId?: number
+ workerNodeKey?: number