UNPKG

worker-tls

Version:

worker-tls 提供了 动态Worker 功能 和 其它一些 Worker 场景下有用的工具集;让开发者可以像调用对象方法一样动态地调用Worker中的方法,也可以随时地往 Worker 中动态地添加函数 等等。

233 lines (103 loc) 2.73 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [worker-tls](./worker-tls.md) &gt; [DynamicWorkerPool](./worker-tls.dynamicworkerpool.md) ## DynamicWorkerPool class 动态Worker池 **Signature:** ```typescript export declare class DynamicWorkerPool<W extends AbstractWorker = Worker> extends WorkerClient<W> ``` **Extends:** [WorkerClient](./worker-tls.workerclient.md)<!-- -->&lt;W&gt; ## Constructors <table><thead><tr><th> Constructor </th><th> Modifiers </th><th> Description </th></tr></thead> <tbody><tr><td> [(constructor)(workerNum, codeOrUrl, workerOptions)](./worker-tls.dynamicworkerpool._constructor_.md) </td><td> </td><td> Constructs a new instance of the `DynamicWorkerPool` class </td></tr> </tbody></table> ## Properties <table><thead><tr><th> Property </th><th> Modifiers </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> [executingCount](./worker-tls.dynamicworkerpool.executingcount.md) </td><td> `readonly` </td><td> number </td><td> </td></tr> <tr><td> [queue](./worker-tls.dynamicworkerpool.queue.md) </td><td> `readonly` </td><td> [SortQueue](./worker-tls.sortqueue.md)<!-- -->&lt;[DWorker](./worker-tls.dworker.md)<!-- -->&lt;W&gt;&gt; </td><td> Worker 队列 </td></tr> <tr><td> [worker](./worker-tls.dynamicworkerpool.worker.md) </td><td> `readonly` </td><td> [DWorker](./worker-tls.dworker.md)<!-- -->&lt;W&gt; </td><td> </td></tr> </tbody></table> ## Methods <table><thead><tr><th> Method </th><th> Modifiers </th><th> Description </th></tr></thead> <tbody><tr><td> [allExecCMD(exec, transfer)](./worker-tls.dynamicworkerpool.allexeccmd.md) </td><td> </td><td> 在所有 worker 中的执行命令 </td></tr> <tr><td> [execCMDOnWorker(worker, exec, transfer)](./worker-tls.dynamicworkerpool.execcmdonworker.md) </td><td> </td><td> 在指定 worker 中的执行命令 </td></tr> <tr><td> [execEnded(worker)](./worker-tls.dynamicworkerpool.execended.md) </td><td> </td><td> </td></tr> <tr><td> [execStarted(worker, execRec)](./worker-tls.dynamicworkerpool.execstarted.md) </td><td> </td><td> </td></tr> <tr><td> [removeCMD(name)](./worker-tls.dynamicworkerpool.removecmd.md) </td><td> </td><td> 移除命令 </td></tr> <tr><td> [setCMD(cmd, name, isProperty)](./worker-tls.dynamicworkerpool.setcmd.md) </td><td> </td><td> 设置命令 </td></tr> </tbody></table>