2019-09-06 16:32:36 +02:00
|
|
|
# @pushrocks/taskbuffer
|
2018-08-04 17:59:01 +02:00
|
|
|
flexible task management. TypeScript ready!
|
|
|
|
|
2019-09-06 16:32:36 +02:00
|
|
|
## Availabililty and Links
|
|
|
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/taskbuffer)
|
|
|
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/taskbuffer)
|
|
|
|
* [github.com (source mirror)](https://github.com/pushrocks/taskbuffer)
|
|
|
|
* [docs (typedoc)](https://pushrocks.gitlab.io/taskbuffer/)
|
2018-08-04 17:59:01 +02:00
|
|
|
|
|
|
|
## Status for master
|
2019-09-06 16:32:36 +02:00
|
|
|
[](https://gitlab.com/pushrocks/taskbuffer/commits/master)
|
|
|
|
[](https://gitlab.com/pushrocks/taskbuffer/commits/master)
|
|
|
|
[](https://www.npmjs.com/package/@pushrocks/taskbuffer)
|
|
|
|
[](https://snyk.io/test/npm/@pushrocks/taskbuffer)
|
|
|
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
|
|
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
|
|
|
[](https://prettier.io/)
|
2018-08-04 17:59:01 +02:00
|
|
|
|
2019-09-06 16:32:36 +02:00
|
|
|
## Usage
|
2018-08-04 18:02:41 +02:00
|
|
|
|
|
|
|
We highly recommend TypeScript as this module supports **TypeScript intellisense**.
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
import * as taskbuffer from "taskbuffer";
|
|
|
|
|
|
|
|
myTask = new taskbuffer.Task({
|
|
|
|
preTask: someOtherTask // optional, don't worry loops are prevented
|
|
|
|
afterTask: someOtherTask // optional, don't worry loops are prevented
|
|
|
|
name:"myTask1",
|
|
|
|
buffered: true, // optional
|
|
|
|
bufferMax: 3, // optional, call qeues greater than this are truncated
|
|
|
|
execDelay: 1000, // optional, time in ms to wait before executing task call
|
|
|
|
taskFunction:() => {
|
|
|
|
// do some stuff and return promise
|
|
|
|
// pass on any data through promise resolution
|
|
|
|
// Use TypeScript for better understanding and code completion
|
|
|
|
}
|
|
|
|
})
|
|
|
|
```
|
2018-08-04 17:59:01 +02:00
|
|
|
|
|
|
|
For further information read the linked docs at the top of this README.
|
|
|
|
|
|
|
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
|
|
|
|
|
|
|
[](https://push.rocks)
|
2019-09-06 16:32:36 +02:00
|
|
|
|
|
|
|
For further information read the linked docs at the top of this readme.
|
|
|
|
|
|
|
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
|
|
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
|
|
|
|
|
|
|
[](https://maintainedby.lossless.com)
|