npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

worker-queue-manager

v1.0.15

Published

Worker队列管理工具

Readme

WorkerQueueManager

WorkerQueueManager是一个worker资源管理工具

开发初衷是想要一个可以管理worker资源的工具,可以让开发者更加专注于业务逻辑的开发,而不用过多关注于woker的通信、资源分配、资源管理。

npm地址

特点:

  1. 针对的使用场景:某个任务需要大量的worker协同,比如大数据处理、机器学习等;
  2. 使用comlink封装了worker的通信,可以直接使用fetch方法发送请求,不需要自己处理worker的通信;
  3. 支持worker的状态管理,可以获取worker的状态,包括是否可用、是否正在工作、worker的通信地址等;
  4. 支持worker的生命周期管理,可以设置worker的最大空闲存活时间,当队列的空闲时间达到最大值时,会自动释放资源;
  5. 支持worker的自动释放,释放后如还有需要会自动重启worker;
  6. 支持设置worker的并发数量,保障资源尽可能地被利用;
  7. 支持worker资源的自动分配,一旦woker空闲,立即分配给下一个任务;
  8. 你可能需要在webpack中正确配置worker-loader才能正常使用这个库;
  9. 你的woker中需要包装一个exec方法,或在go的opthion.callName中指定某个方法为worker的入口方法;

使用

安装

npm i worker-queue-manager

引入依赖 创建变量

  import { WorkerQueueManager } from 'worker-queue-manager'
  import RtrWorker from '../workers/mask2rt.worker.js'

  const workerQueueManager = new WorkerQueueManager(RtrWorker, 30000);

  export default async function rtReconstrction(structure, options) {
    const result = await workerQueueManager.go(structure, options)
    return result
  }