fix(tests): now using tstest
This commit is contained in:
@ -1,13 +1,16 @@
|
||||
# taskbuffer
|
||||
|
||||
flexible task management. TypeScript ready!
|
||||
|
||||
## Availabililty
|
||||
|
||||
[](https://www.npmjs.com/package/taskbuffer)
|
||||
[](https://GitLab.com/pushrocks/taskbuffer)
|
||||
[](https://github.com/pushrocks/taskbuffer)
|
||||
[](https://pushrocks.gitlab.io/taskbuffer/)
|
||||
|
||||
## Status for master
|
||||
|
||||
[](https://GitLab.com/pushrocks/taskbuffer/commits/master)
|
||||
[](https://GitLab.com/pushrocks/taskbuffer/commits/master)
|
||||
[](https://www.npmjs.com/package/taskbuffer)
|
||||
@ -24,36 +27,41 @@ flexible task management. TypeScript ready!
|
||||
npm install taskbuffer --save
|
||||
```
|
||||
|
||||
## Concepts
|
||||
## Concepts
|
||||
|
||||
### class `Task`
|
||||
* A Task in its most simple form is a function that is executed when the task runs.
|
||||
* A Task can have a **preTask** and an **afterTask**
|
||||
|
||||
- A Task in its most simple form is a function that is executed when the task runs.
|
||||
- A Task can have a **preTask** and an **afterTask**
|
||||
(those are run before or after the main function whenever the task is called)
|
||||
* A Task can be buffered.
|
||||
- A Task can be buffered.
|
||||
That means it can be called multiple times in a very short time.
|
||||
However execution happens in line:
|
||||
meaning execution of the task's main function is on halt until the previous task call has finished.
|
||||
You can set bufferMax number, which is the max number of buffered task calls.
|
||||
Any additional calls will then be truncated
|
||||
* Task.trigger() and Task.triggerBuffered() always return a Promise
|
||||
- Task.trigger() and Task.triggerBuffered() always return a Promise
|
||||
which is fullfilled once the related task call has completed.
|
||||
* Task.triggered() is an Observable stream that emits events every time a task call is called and every time a call is completed.
|
||||
* Task is compatible to gulp streams.
|
||||
- Task.triggered() is an Observable stream that emits events every time a task call is called and every time a call is completed.
|
||||
- Task is compatible to gulp streams.
|
||||
|
||||
### class `TaskChain`
|
||||
* TaskChain extends Task.
|
||||
* Multiple Tasks can be combined in a bigger task using a TaskChain.
|
||||
* While the tasks are async in themselve, TaskChain **runs Tasks serialized** (one after the other)
|
||||
* that means that tasks can rely on each other and
|
||||
|
||||
- TaskChain extends Task.
|
||||
- Multiple Tasks can be combined in a bigger task using a TaskChain.
|
||||
- While the tasks are async in themselve, TaskChain **runs Tasks serialized** (one after the other)
|
||||
- that means that tasks can rely on each other and
|
||||
|
||||
### class `TaskParallel`
|
||||
* TaskParallel extends Task.
|
||||
* like TaskChain, however **tasks run in parallel**
|
||||
* Tasks cannot rely on each other.
|
||||
|
||||
- TaskParallel extends Task.
|
||||
- like TaskChain, however **tasks run in parallel**
|
||||
- Tasks cannot rely on each other.
|
||||
|
||||
### Usage
|
||||
|
||||
We highly recommend TypeScript as this module supports **TypeScript intellisense**.
|
||||
|
||||
```javascript
|
||||
import * as taskbuffer from "taskbuffer";
|
||||
|
||||
|
Reference in New Issue
Block a user