concurrency-light
Lightweight concurrency management
Last updated 8 months ago by cygnusroboticus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install concurrency-light 
SYNC missed versions from official npm registry.

concurrency-light

Lightweight concurrency management, heavily inspired by ember-concurrency.

Installation

  • yarn add concurrency-light
  • npm install --save concurrency-light

Usage

import { task, TaskStrategy, timeout } from "concurrency-light";

class DocClass {
  constructor() {
    this.asyncSearch("pants");
    this.asyncSearch.isRunning; // true
    this.asyncSearch("skirts"); // restarted
  }

  @task({ strategy: TaskStrategy.Restart })
  *asyncSearch(search: string) {
    yield timeout(500);
    yield fetch(`/api/search?filter[query]=${search}`);
  }
}

Current Tags

  • 0.2.8                                ...           latest (8 months ago)

9 Versions

  • 0.2.8                                ...           8 months ago
  • 0.2.7                                ...           8 months ago
  • 0.2.6                                ...           8 months ago
  • 0.1.6                                ...           a year ago
  • 0.1.5                                ...           a year ago
  • 0.1.4                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (0)
None
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |