2016-08-01 16:10:00 +02:00
|
|
|
import * as helpers from "./taskbuffer.classes.helpers";
|
2016-08-01 13:17:15 +02:00
|
|
|
export interface ITaskFunction {
|
2016-08-02 11:09:42 +02:00
|
|
|
(x?: any): PromiseLike<any>;
|
2016-08-01 13:17:15 +02:00
|
|
|
}
|
2016-05-04 04:28:50 +02:00
|
|
|
export declare class Task {
|
2016-05-14 04:28:22 +02:00
|
|
|
name: string;
|
2016-08-02 11:09:42 +02:00
|
|
|
taskFunction: ITaskFunction;
|
2016-05-04 04:28:50 +02:00
|
|
|
buffered: boolean;
|
|
|
|
preTask: Task;
|
|
|
|
afterTask: Task;
|
2016-08-01 16:10:00 +02:00
|
|
|
running: boolean;
|
|
|
|
bufferRunner: helpers.BufferRunner;
|
|
|
|
cycleCounter: helpers.CycleCounter;
|
|
|
|
idle: boolean;
|
|
|
|
private _state;
|
2016-05-05 18:36:31 +02:00
|
|
|
constructor(optionsArg: {
|
2016-08-01 13:17:15 +02:00
|
|
|
taskFunction: ITaskFunction;
|
2016-05-04 04:28:50 +02:00
|
|
|
preTask?: Task;
|
|
|
|
afterTask?: Task;
|
|
|
|
buffered?: boolean;
|
2016-05-05 19:21:50 +02:00
|
|
|
bufferMax?: number;
|
2016-05-14 23:24:11 +02:00
|
|
|
name?: string;
|
2016-05-04 04:28:50 +02:00
|
|
|
});
|
2016-08-01 13:17:15 +02:00
|
|
|
/**
|
|
|
|
* trigger the task. Will trigger buffered if this.buffered is true
|
|
|
|
*/
|
2016-08-03 14:51:43 +02:00
|
|
|
trigger(x?: any): Promise<any>;
|
2016-08-01 13:17:15 +02:00
|
|
|
/**
|
|
|
|
* trigger task unbuffered.
|
|
|
|
*/
|
2016-08-03 14:51:43 +02:00
|
|
|
triggerUnBuffered(x?: any): Promise<any>;
|
2016-08-01 13:17:15 +02:00
|
|
|
/**
|
|
|
|
* trigger task buffered.
|
|
|
|
*/
|
2016-08-03 14:51:43 +02:00
|
|
|
triggerBuffered(x?: any): Promise<any>;
|
2016-05-04 04:28:50 +02:00
|
|
|
state: string;
|
|
|
|
}
|