Job Components: `Operations Slicer Default`
operations/slicer.default
The simpliest form a "Slicer"
See [[SlicerCore]]
Type parameters
Name | Type |
---|---|
T | OpConfig |
Hierarchy
Table of contents
Constructors
Properties
Accessors
Methods
- canComplete
- createAPI
- createSlice
- getAPI
- getSlice
- getSlices
- handle
- initialize
- isRecoverable
- maxQueueLength
- onExecutionStats
- shutdown
- slice
- sliceCount
- slicers
Constructors
constructor
• new default<T
>(context
, opConfig
, executionConfig
): default
<T
>
Type parameters
Name | Type |
---|---|
T | OpConfig |
Parameters
Name | Type |
---|---|
context | WorkerContext |
opConfig | OpConfig & T |
executionConfig | ExecutionConfig |
Returns
default
<T
>
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:37
Properties
context
• Readonly
context: Readonly
<WorkerContext
>
Inherited from
Defined in
packages/job-components/src/operations/core/core.ts:10
events
• Readonly
events: EventEmitter
Inherited from
Defined in
packages/job-components/src/operations/core/core.ts:13
executionConfig
• Readonly
executionConfig: Readonly
<ExecutionConfig
>
Inherited from
Defined in
packages/job-components/src/operations/core/core.ts:11
isFinished
• isFinished: boolean
= false
Defined in
packages/job-components/src/operations/slicer.ts:16
logger
• Readonly
logger: Logger
Inherited from
Defined in
packages/job-components/src/operations/core/core.ts:12
opConfig
• Protected
Readonly
opConfig: Readonly
<OpConfig
& T
>
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:34
recoveryData
• Protected
recoveryData: SlicerRecoveryData
[]
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:33
stats
• Protected
stats: ExecutionStats
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:32
Accessors
workersConnected
• get
workersConnected(): number
Returns
number
Inherited from
SlicerCore.workersConnected
Defined in
packages/job-components/src/operations/core/slicer-core.ts:175
Methods
canComplete
▸ canComplete(): boolean
Returns
boolean
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:171
createAPI
▸ createAPI<A
>(name
, ...params
): Promise
<A
>
Create an API and add it to the operation lifecycle
Type parameters
Name | Type |
---|---|
A | extends OpAPI = OpAPI |
Parameters
Name | Type |
---|---|
name | string |
...params | any [] |
Returns
Promise
<A
>
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:74
createSlice
▸ createSlice(input
, order
, id?
): void
Create a Slice object from a slice request. In the case of recovery the "Slice" already has the required This will be enqueued and dequeued by the "Execution Controller"
Parameters
Name | Type | Default value | |
---|---|---|---|
input | Slice \ | SliceRequest | undefined |
order | number | undefined | |
id | number | 0 |
Returns
void
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:102
getAPI
▸ getAPI<A
>(name
): A
Get a reference to an existing API
Type parameters
Name | Type |
---|---|
A | extends OpAPI = OpAPI |
Parameters
Name | Type |
---|---|
name | string |
Returns
A
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:81
getSlice
▸ getSlice(): null
| Slice
A method called by the "Execution Controller" to dequeue a created "Slice"
Returns
null
| Slice
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:119
getSlices
▸ getSlices(max
): Slice
[]
A method called by the "Execution Controller" to dequeue many created slices
Parameters
Name | Type |
---|---|
max | number |
Returns
Slice
[]
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:128
handle
▸ handle(): Promise
<boolean
>
A generic method called by the Teraslice framework to a give a "Slicer" the ability to handle creating slices.
Returns
Promise
<boolean
>
a boolean depending on whether the slicer is done
Overrides
Defined in
packages/job-components/src/operations/slicer.ts:28
initialize
▸ initialize(recoveryData
): Promise
<void
>
Called during execution initialization
Parameters
Name | Type | Description |
---|---|---|
recoveryData | SlicerRecoveryData [] | is the data to recover from |
Returns
Promise
<void
>
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:62
isRecoverable
▸ isRecoverable(): boolean
Used to indicate whether this slicer is recoverable.
Returns
boolean
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:153
maxQueueLength
▸ maxQueueLength(): number
Used to determine the maximum number of slices queued. Defaults to 10000 NOTE: if you want to base of the number of workers use #workersConnected
Returns
number
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:163
onExecutionStats
▸ onExecutionStats(stats
): void
A method called by the "Execution Controller" to give a "Slicer" the opportunity to track various slicer satistics
Parameters
Name | Type |
---|---|
stats | ExecutionStats |
Returns
void
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:167
shutdown
▸ shutdown(): Promise
<void
>
Called during execution shutdown, when this is cleanup any open connections or destroy any in-memory state.
Returns
Promise
<void
>
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:67
slice
▸ slice(): Promise
<SlicerResult
>
A method called by Slicer#handle
Returns
Promise
<SlicerResult
>
a Slice, or SliceRequest
Defined in
packages/job-components/src/operations/slicer.ts:22
sliceCount
▸ sliceCount(): number
The number of enqueued slices
Returns
number
Inherited from
Defined in
packages/job-components/src/operations/core/slicer-core.ts:146
slicers
▸ slicers(): number
Return the number of registered slicers
Returns
number