Skip to content

Commit eb487fd

Browse files
committed
Added syncWorker
1 parent 6de5a0c commit eb487fd

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/taskDefinition.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ export interface ITaskDefinition {
7070
*/
7171
output?: object;
7272
};
73+
/**
74+
* The flag marked task as sync worker (worker that use sync api to update it's state)
75+
* Affect while cancel,or other task in parallel failed, and need to compensate
76+
* Workflow will start compensate without waiting for the task to finished
77+
*
78+
* @default false
79+
* @TJS-type boolean
80+
*/
81+
syncWorker?: boolean;
7382
}
7483

7584
export class TaskDefinition implements ITaskDefinition {

src/workflowDefinition.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ export interface ITaskTask extends IBaseTask {
6464
*/
6565
delay?: number | string;
6666
};
67+
/**
68+
* The flag marked task as sync worker (worker that use sync api to update it's state)
69+
* Affect while cancel,or other task in parallel failed, and need to compensate
70+
* Workflow will start compensate without waiting for the task to finished
71+
*
72+
* @default false
73+
* @TJS-type boolean
74+
*/
75+
syncWorker?: boolean;
6776
}
6877

6978
/**
@@ -74,7 +83,8 @@ export interface ITaskTask extends IBaseTask {
7483
*/
7584
export type Tasks = AllTaskType[];
7685

77-
export interface ICompensateTask extends Omit<ITaskTask, 'type'> {
86+
export interface ICompensateTask
87+
extends Omit<ITaskTask, 'type' | 'syncWorker'> {
7888
type: TaskTypes.Compensate;
7989
}
8090

0 commit comments

Comments
 (0)