---
title: "Discussion on \"关于任务队列的实现\" | Hashnode"
description: "Discussion on \"关于任务队列的实现\". 背景\n或者叫任务池吧，我也不太确定这个的学名叫啥，反正就是那种可以限制同一时间执行的任务数量的工具函数。\n我前两天偷懒让 LLM（Claude）给我生成了一段，他是这样写的：\nexport const runConcurrency = async <T>(\n  tasks: Array<() => Promise<T>>, \n  concurrency: number = 3\n): Promise<Array<T | Error>> => {\n  const results: Array<T |..."
url: "https://hashnode.com/posts/5ywz5lqo5lu75yqh6zif5yix55qe5a6e546w/6736e2ec869868a53334e06e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [关于任务队列的实现](https://erio.hashnode.dev/5ywz5lqo5lu75yqh6zif5yix55qe5a6e546w?utm_source=hashnode&utm_medium=feed)

背景 或者叫任务池吧，我也不太确定这个的学名叫啥，反正就是那种可以限制同一时间执行的任务数量的工具函数。 我前两天偷懒让 LLM（Claude）给我生成了一段，他是这样写的： export const runConcurrency = async <T>( tasks: Array<() => Promise<T>>, concurrency: number = 3 ): Promise<Array<T | Error>> => { const results: Array<T |...

Nov 15, 2024 · 2 min read · erio.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#task-queue](https://hashnode.com/tag/task-queue)

## Written by

[Erioifpud](https://hashnode.com/@Erioifpud)

@Erioifpud

  
[View profile](https://hashnode.com/@Erioifpud)

Development

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
