@belongs/asyncutil
``` npm install @belongs/asyncutil --save ```
Last updated a year ago by belongs .
MIT · Original npm · Tarball · package.json
$ cnpm install @belongs/asyncutil 
SYNC missed versions from official npm registry.

Install

npm install @belongs/asyncutil --save

Usage

Roll

To process a data set a given concurrency level.

await roll(items, (item) => { /* async processor of item */ }, concurrencyLevel);

Hub

To make only one async call for multiple incoming request and cache the output.

const hub = new Hub(()=> { /* to fetch the data */ }, cacheTimeout);
const data = await hub.get();

Here the callback function will be called only once even hub.get() is called multiple times.

Current Tags

  • 0.0.5                                ...           latest (a year ago)

5 Versions

  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 1
Last Month 8
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |