Skip to content

Class: TaskProcessor

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new TaskProcessor(config?): TaskProcessor

Parameters

NameType
config?ITaskProcessorConfig

Returns

TaskProcessor

Defined in

leafer/packages/task/src/TaskProcessor.ts:52

Properties

config

config: ITaskProcessorConfig

Implementation of

ITaskProcessor.config

Defined in

leafer/packages/task/src/TaskProcessor.ts:9


list

Protected list: ITaskItem[] = []

Defined in

leafer/packages/task/src/TaskProcessor.ts:11


parallelList

Protected parallelList: ITaskItem[]

Defined in

leafer/packages/task/src/TaskProcessor.ts:13


parallelSuccessNumber

Protected parallelSuccessNumber: number

Defined in

leafer/packages/task/src/TaskProcessor.ts:14


running

running: boolean = false

Implementation of

ITaskProcessor.running

Defined in

leafer/packages/task/src/TaskProcessor.ts:16


isComplete

isComplete: boolean = true

Implementation of

ITaskProcessor.isComplete

Defined in

leafer/packages/task/src/TaskProcessor.ts:17


timer

Protected timer: any

Defined in

leafer/packages/task/src/TaskProcessor.ts:19


index

index: number = 0

Implementation of

ITaskProcessor.index

Defined in

leafer/packages/task/src/TaskProcessor.ts:23


delayNumber

delayNumber: number = 0

Defined in

leafer/packages/task/src/TaskProcessor.ts:25

Accessors

total

get total(): number

Returns

number

Implementation of

ITaskProcessor.total

Defined in

leafer/packages/task/src/TaskProcessor.ts:21


finishedIndex

get finishedIndex(): number

Returns

number

Implementation of

ITaskProcessor.finishedIndex

Defined in

leafer/packages/task/src/TaskProcessor.ts:27


remain

get remain(): number

Returns

number

Implementation of

ITaskProcessor.remain

Defined in

leafer/packages/task/src/TaskProcessor.ts:31


percent

get percent(): number

Returns

number

Implementation of

ITaskProcessor.percent

Defined in

leafer/packages/task/src/TaskProcessor.ts:35

Methods

add

add(taskCallback, options?): ITaskItem

Parameters

NameType
taskCallbackIFunction
options?number | ITaskOptions

Returns

ITaskItem

Implementation of

ITaskProcessor.add

Defined in

leafer/packages/task/src/TaskProcessor.ts:59


push

push(task, start?): void

Parameters

NameType
taskITaskItem
start?boolean

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:94


empty

empty(): void

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:101


start

start(): void

Returns

void

Implementation of

ITaskProcessor.start

Defined in

leafer/packages/task/src/TaskProcessor.ts:111


pause

pause(): void

Returns

void

Implementation of

ITaskProcessor.pause

Defined in

leafer/packages/task/src/TaskProcessor.ts:119


resume

resume(): void

Returns

void

Implementation of

ITaskProcessor.resume

Defined in

leafer/packages/task/src/TaskProcessor.ts:125


skip

skip(): void

Returns

void

Implementation of

ITaskProcessor.skip

Defined in

leafer/packages/task/src/TaskProcessor.ts:129


stop

stop(): void

Returns

void

Implementation of

ITaskProcessor.stop

Defined in

leafer/packages/task/src/TaskProcessor.ts:134


run

run(): void

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:143


runTask

runTask(): void

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:159


runParallelTasks

runParallelTasks(): void

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:177


runParallelTask

runParallelTask(task): void

Parameters

NameType
taskITaskItem

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:181


nextTask

nextTask(): void

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:192


setParallelList

setParallelList(): void

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:200


fillParallelTask

fillParallelTask(): void

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:220


onComplete

onComplete(): void

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:258


onTask

onTask(task): void

Parameters

NameType
taskITaskItem

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:263


onParallelError

onParallelError(error): void

Parameters

NameType
errorunknown

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:268


onError

onError(error): void

Parameters

NameType
errorunknown

Returns

void

Defined in

leafer/packages/task/src/TaskProcessor.ts:279


destroy

destroy(): void

Returns

void

Implementation of

ITaskProcessor.destroy

Defined in

leafer/packages/task/src/TaskProcessor.ts:284

Released under the MIT License.