Job Components: `Interfaces Operation Lifecycle Worker Operation Life Cycle`
interfaces/operation-lifecycle.WorkerOperationLifeCycle
Hierarchy
-
↳
WorkerOperationLifeCycle
Implemented by
Table of contents
Methods
- initialize
- onFlushEnd
- onFlushStart
- onOperationComplete
- onOperationStart
- onSliceFailed
- onSliceFinalizing
- onSliceFinished
- onSliceInitialized
- onSliceRetry
- onSliceStarted
- shutdown
Methods
initialize
▸ initialize(initConfig?
): Promise
<void
>
Called during execution initialization, when this is called perform any async setup.
Parameters
Name | Type |
---|---|
initConfig? | any |
Returns
Promise
<void
>
Inherited from
Defined in
packages/job-components/src/interfaces/operation-lifecycle.ts:11
onFlushEnd
▸ onFlushEnd(sliceId
): Promise
<void
>
Called to notify the processors that the slice is finished being flushed (shutdown will likely be called immediately afterwards)
Parameters
Name | Type |
---|---|
sliceId | string |
Returns
Promise
<void
>
Defined in
packages/job-components/src/interfaces/operation-lifecycle.ts:90
onFlushStart
▸ onFlushStart(sliceId
): Promise
<void
>
Called to notify the processors that the next slice being passed through will be an empty slice used to flush any additional in-memory state.
Parameters
Name | Type |
---|---|
sliceId | string |
Returns
Promise
<void
>
Defined in
packages/job-components/src/interfaces/operation-lifecycle.ts:84
onOperationComplete
▸ onOperationComplete(sliceId
, index
, processed
, records
): void
Called immediately after an operation has ended
Parameters
Name | Type | Description |
---|---|---|
sliceId | string | is the id of the slice being processed |
index | number | the index to the operation which completed |
processed | number | is the number of records returned from last op |
records | DataEntity <Record <string , any >, _DataEntityMetadata <Record <string , any >>>[] | - |
Returns
void
Defined in
packages/job-components/src/interfaces/operation-lifecycle.ts:72
onOperationStart
▸ onOperationStart(sliceId
, index
): void
Called immediately before an operation is started
Parameters
Name | Type | Description |
---|---|---|
sliceId | string | is the id of the slice being processed |
index | number | the index to the operation which completed |
Returns
void
Defined in
packages/job-components/src/interfaces/operation-lifecycle.ts:62
onSliceFailed
▸ onSliceFailed(sliceId
): Promise
<void
>
Called after the slice has been marked as "Failed"
Parameters
Name | Type |
---|---|
sliceId | string |
Returns
Promise
<void
>
Defined in
packages/job-components/src/interfaces/operation-lifecycle.ts:45
onSliceFinalizing
▸ onSliceFinalizing(sliceId
): Promise
<void
>
Called after a slice is done with the last operation in the execution
Parameters
Name | Type |
---|---|
sliceId | string |
Returns
Promise
<void
>
Defined in
packages/job-components/src/interfaces/operation-lifecycle.ts:35
onSliceFinished
▸ onSliceFinished(sliceId
): Promise
<void
>
Called after the slice has been acknowledged by the "Execution Controller"
Parameters
Name | Type |
---|---|
sliceId | string |
Returns
Promise
<void
>
Defined in
packages/job-components/src/interfaces/operation-lifecycle.ts:40
onSliceInitialized
▸ onSliceInitialized(sliceId
): Promise
<void
>
Called after a slice is initializated, but before the slice has been handed to any operation.
Parameters
Name | Type |
---|---|
sliceId | string |
Returns
Promise
<void
>
Defined in
packages/job-components/src/interfaces/operation-lifecycle.ts:25
onSliceRetry
▸ onSliceRetry(sliceId
): Promise
<void
>
Called after the operation failed to process the slice but before the slice is retried.
NOTE: A retry can be stopped by throw an error inside this function
Parameters
Name | Type |
---|---|
sliceId | string |
Returns
Promise
<void
>
Defined in
packages/job-components/src/interfaces/operation-lifecycle.ts:53
onSliceStarted
▸ onSliceStarted(sliceId
): Promise
<void
>
Called after a the slice is sent to the "Fetcher"
Parameters
Name | Type |
---|---|
sliceId | string |
Returns
Promise
<void
>
Defined in
packages/job-components/src/interfaces/operation-lifecycle.ts:30
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/interfaces/operation-lifecycle.ts:17