Class BaseTask
🏭 Constructors
constructor
new BaseTask(): BaseTask<T>
Return Type
BaseTask<T>
Defined in: packages/task/index.ts:95
🏷️ Properties
_from
_from: undefined | string
Defined in: packages/task/index.ts:80
_id
_id: number = 0
Defined in: packages/task/index.ts:85
_path
_path: string = ''
Defined in: packages/task/index.ts:84
_progress
_progress: number = 0
Defined in: packages/task/index.ts:82
_promise
_promise: Promise<T>
Defined in: packages/task/index.ts:75
_state
_state: TaskState = TaskState.Idle
Defined in: packages/task/index.ts:74
_to
_to: undefined | string
Defined in: packages/task/index.ts:81
_total
_total: number = -1
Defined in: packages/task/index.ts:83
context
context: TaskContext = {}
Defined in: packages/task/index.ts:88
name
name: string = ''
Defined in: packages/task/index.ts:90
param
param: object = {}
Defined in: packages/task/index.ts:91
parent
parent: undefined | Task<any>
Defined in: packages/task/index.ts:87
reject
reject: Function
Defined in: packages/task/index.ts:78
resolve
resolve: Function
Defined in: packages/task/index.ts:77
resultOrError
resultOrError: any
Defined in: packages/task/index.ts:93
🔑 Accessors
from
Defined in: packages/task/index.ts:121
id
Defined in: packages/task/index.ts:116
isCancelled
Defined in: packages/task/index.ts:124
isDone
Defined in: packages/task/index.ts:126
isPaused
Defined in: packages/task/index.ts:125
isRunning
Defined in: packages/task/index.ts:127
path
Defined in: packages/task/index.ts:117
progress
Defined in: packages/task/index.ts:118
state
Defined in: packages/task/index.ts:122
to
Defined in: packages/task/index.ts:120
total
Defined in: packages/task/index.ts:119
🔧 Methods
cancel
cancel(timeout: number): Promise<void>
Parameters
- timeout:
number
Return Type
Promise<void>
Defined in: packages/task/index.ts:145
cancelTask
cancelTask(): Promise<void>
Return Type
Promise<void>
Defined in: packages/task/index.ts:208
get
get(): void | T
Return Type
void | T
Defined in: packages/task/index.ts:108
map
map(transform: Transform<BaseTask<T>, N>): Task<N extends Promise<R> ? R : N>
Parameters
- transform:
Transform<BaseTask<T>, N>
Return Type
Task<N extends Promise<R> ? R : N>
Defined in: packages/task/index.ts:212
onChildUpdate
onChildUpdate(chunkSize: number): void
Parameters
- chunkSize:
number
Return Type
void
Defined in: packages/task/index.ts:205
pause
pause(): Promise<void>
Return Type
Promise<void>
Defined in: packages/task/index.ts:129
pauseTask
pauseTask(): Promise<void>
Return Type
Promise<void>
Defined in: packages/task/index.ts:209
resume
resume(): Promise<void>
Return Type
Promise<void>
Defined in: packages/task/index.ts:137
resumeTask
resumeTask(): Promise<void>
Return Type
Promise<void>
Defined in: packages/task/index.ts:210
runTask
runTask(): Promise<T>
Return Type
Promise<T>
Defined in: packages/task/index.ts:207
setName
setName(name: string, param: object): BaseTask<T>
Parameters
- name:
string
- param:
object
Return Type
BaseTask<T>
Defined in: packages/task/index.ts:102
start
start(context: TaskContext, parent: Task<any>): void
Parameters
- context:
TaskContext
- parent:
Task<any>
Return Type
void
Defined in: packages/task/index.ts:164
startAndWait
startAndWait(context: TaskContext, parent: Task<any>): Promise<T>
Parameters
- context:
TaskContext
- parent:
Task<any>
Return Type
Promise<T>
Defined in: packages/task/index.ts:195
update
update(chunkSize: number): void
Parameters
- chunkSize:
number
Return Type
void
Defined in: packages/task/index.ts:200
wait
wait(): Promise<T>
Return Type
Promise<T>
Defined in: packages/task/index.ts:160