Class: TaskProcessor
Implements
Table of contents
Constructors
Properties
Accessors
Methods
- add
- push
- empty
- start
- pause
- resume
- skip
- stop
- run
- runTask
- runParallelTasks
- runParallelTask
- nextTask
- setParallelList
- fillParallelTask
- onComplete
- onTask
- onParallelError
- onError
- destroy
Constructors
constructor
• new TaskProcessor(config?
): TaskProcessor
Parameters
Name | Type |
---|---|
config? | ITaskProcessorConfig |
Returns
Defined in
leafer/packages/task/src/TaskProcessor.ts:52
Properties
config
• config: ITaskProcessorConfig
Implementation of
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
Defined in
leafer/packages/task/src/TaskProcessor.ts:16
isComplete
• isComplete: boolean
= true
Implementation of
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
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
Defined in
leafer/packages/task/src/TaskProcessor.ts:21
finishedIndex
• get
finishedIndex(): number
Returns
number
Implementation of
Defined in
leafer/packages/task/src/TaskProcessor.ts:27
remain
• get
remain(): number
Returns
number
Implementation of
Defined in
leafer/packages/task/src/TaskProcessor.ts:31
percent
• get
percent(): number
Returns
number
Implementation of
Defined in
leafer/packages/task/src/TaskProcessor.ts:35
Methods
add
▸ add(taskCallback
, options?
): ITaskItem
Parameters
Name | Type |
---|---|
taskCallback | IFunction |
options? | number | ITaskOptions |
Returns
Implementation of
Defined in
leafer/packages/task/src/TaskProcessor.ts:59
push
▸ push(task
, start?
): void
Parameters
Name | Type |
---|---|
task | ITaskItem |
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
Defined in
leafer/packages/task/src/TaskProcessor.ts:111
pause
▸ pause(): void
Returns
void
Implementation of
Defined in
leafer/packages/task/src/TaskProcessor.ts:119
resume
▸ resume(): void
Returns
void
Implementation of
Defined in
leafer/packages/task/src/TaskProcessor.ts:125
skip
▸ skip(): void
Returns
void
Implementation of
Defined in
leafer/packages/task/src/TaskProcessor.ts:129
stop
▸ stop(): void
Returns
void
Implementation of
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
Name | Type |
---|---|
task | ITaskItem |
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
Name | Type |
---|---|
task | ITaskItem |
Returns
void
Defined in
leafer/packages/task/src/TaskProcessor.ts:263
onParallelError
▸ onParallelError(error
): void
Parameters
Name | Type |
---|---|
error | unknown |
Returns
void
Defined in
leafer/packages/task/src/TaskProcessor.ts:268
onError
▸ onError(error
): void
Parameters
Name | Type |
---|---|
error | unknown |
Returns
void
Defined in
leafer/packages/task/src/TaskProcessor.ts:279
destroy
▸ destroy(): void
Returns
void