update README on how buffered Tasks work.
This commit is contained in:
parent
72504d7ad7
commit
48c20c081f
10
README.md
10
README.md
@ -14,8 +14,14 @@ npm install taskbuffer --save
|
|||||||
|
|
||||||
#### Task
|
#### Task
|
||||||
* A Task in its most simple form is a function that is executed when the task runs.
|
* A Task in its most simple form is a function that is executed when the task runs.
|
||||||
* It can have a preTaska and an afterTask (those are run before or after the main function whenever the task is called)
|
* A Task can have a **preTask** and an **afterTask**
|
||||||
* 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.
|
(those are run before or after the main function whenever the task is called)
|
||||||
|
* 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;
|
||||||
* Task.triggered() is an ObservableStram that emits events every time a task is promised.
|
* Task.triggered() is an ObservableStram that emits events every time a task is promised.
|
||||||
* Task is compatible to gulp streams.
|
* Task is compatible to gulp streams.
|
||||||
|
@ -7,8 +7,9 @@ export class Task {
|
|||||||
idle:boolean;
|
idle:boolean;
|
||||||
running:boolean;
|
running:boolean;
|
||||||
buffered:boolean;
|
buffered:boolean;
|
||||||
private _counterBufferRelative;
|
bufferCounter:number;
|
||||||
private _counterTriggerAbsolute;
|
bufferMax:number;
|
||||||
|
private _counterTriggerAbsolute:number;
|
||||||
private _state:string;
|
private _state:string;
|
||||||
preTask:Task;
|
preTask:Task;
|
||||||
afterTask:Task;
|
afterTask:Task;
|
||||||
|
Loading…
Reference in New Issue
Block a user