This repository was archived by the owner on May 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # node-task-pool
1+ # node-task-pool
2+
3+ [ ![ Latest version] ( https://img.shields.io/github/v/release/ghosind/node-task-pool?include_prereleases )] ( https://github.com/ghosind/node-task-pool )
4+ [ ![ NPM] ( https://img.shields.io/npm/v/@antmind/task-pool )] ( https://www.npmjs.com/package/@antmind/task-pool )
5+ [ ![ Github Actions build] ( https://img.shields.io/github/workflow/status/ghosind/node-task-pool/Node.js%20CI )] ( https://github.com/ghosind/node-task-pool )
6+ [ ![ Codacy Badge] ( https://app.codacy.com/project/badge/Grade/b00f10bfb94641eea45837c973c2f86b )] ( https://www.codacy.com/gh/ghosind/node-task-pool/dashboard?utm_source=github.com& ; utm_medium=referral& ; utm_content=ghosind/node-task-pool& ; utm_campaign=Badge_Grade )
7+ [ ![ codecov] ( https://codecov.io/gh/ghosind/node-task-pool/branch/main/graph/badge.svg?token=UZ7SOSC9RH )] ( https://codecov.io/gh/ghosind/node-task-pool )
8+ [ ![ License] ( https://img.shields.io/github/license/ghosind/node-task-pool )] ( https://github.com/ghosind/node-task-pool )
9+
10+ ` @antmind/task-pool ` is a simple Node.js functional tasks pool implementation, supported both synchronous and asynchronous functions.
11+
12+ ## Installation
13+
14+ Using NPM:
15+
16+ ``` sh
17+ npm install --save @antmind/task-pool
18+ ```
19+
20+ ## Getting Start
21+
22+ ``` ts
23+ import { Task , TaskPool } from ' @antmind/task-pool' ;
24+
25+ const pool = new TaskPool ({ size: 5 });
26+ pool .addTask (new Task ((val : any ) -> { console.log(' hello' , val) }, ' world' ));
27+
28+ pool .exec ();
29+ ```
Original file line number Diff line number Diff line change 11{
2- "name" : " task-pool" ,
2+ "name" : " @antmind/ task-pool" ,
33 "version" : " 0.0.1" ,
4- "description" : " A simple Node.js functional task pool implementation, supported both synchronous and asynchronous functions." ,
4+ "description" : " A simple Node.js functional tasks pool implementation, supported both synchronous and asynchronous functions." ,
55 "main" : " ./lib/index.js" ,
66 "scripts" : {
77 "build" : " tsc" ,
4040 "nyc" : " ^15.1.0" ,
4141 "ts-node" : " ^9.1.1" ,
4242 "typescript" : " ^4.1.3"
43- }
43+ },
44+ "directories" : {
45+ "lib" : " lib" ,
46+ "test" : " test"
47+ },
48+ "dependencies" : {}
4449}
You can’t perform that action at this time.
0 commit comments