Skip to content

tvastar/jsq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsq

jsq is a simple Javascript async queue (implemented with modern ES6 code).

Usage

import {Queue, Retry, LocalStorage} from "jsq";

class AsyncTasks {
    constructor() {
       let storage = new LocalStorage(window.localStorage, "some key");
       let worker = items => this.processTasks(items);
       this.q = new Queue(Retry(items), storage);
    }

    schedule(task) {
       this.q.push(task);
    }

    async processTasks(tasks) {
        ... actually process the taskss...
    }
}

Details

The module is rather small. See the index.js for details.

About

javascript async queue

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published