taskbuffer/ts/taskbuffer.classes.distributedcoordinator.ts

42 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-11-14 13:54:26 +00:00
import { Task } from './taskbuffer.classes.task.js';
2022-11-09 09:36:18 +00:00
import * as plugins from './taskbuffer.plugins.js';
2022-11-14 13:54:26 +00:00
/**
* constains all data for the final coordinator to actually make an informed decision
*/
2023-01-19 13:20:44 +00:00
export interface IDistributedTaskRequest {
2023-01-19 13:09:56 +00:00
/**
* this needs to correlate to the consultationResult
*/
2023-01-07 18:05:29 +00:00
submitterRandomId: string;
2022-11-14 13:54:26 +00:00
taskName: string;
taskVersion: string;
taskExecutionTime: number;
taskExecutionTimeout: number;
taskExecutionParallel: number;
status: 'requesting' | 'gotRejected' | 'failed' | 'succeeded';
}
2023-01-19 13:21:36 +00:00
export interface IDistributedTaskRequestResult {
2023-01-19 13:09:56 +00:00
/**
* this needs to correlate to the decisionInfoBasis
*/
submitterRandomId: string;
2023-07-26 12:16:33 +00:00
/**
* can be used while debugging
*/
2022-11-14 13:54:26 +00:00
considered: boolean;
rank: string;
reason: string;
shouldTrigger: boolean;
}
2023-01-09 17:40:38 +00:00
export abstract class AbstractDistributedCoordinator {
2023-07-26 12:16:33 +00:00
public abstract fireDistributedTaskRequest(
infoBasisArg: IDistributedTaskRequest
): Promise<IDistributedTaskRequestResult>;
public abstract updateDistributedTaskRequest(
infoBasisArg: IDistributedTaskRequest
): Promise<void>;
}