fix(core): update

This commit is contained in:
Philipp Kunz 2023-01-09 18:40:38 +01:00
parent 973678d635
commit 4d2756b743
3 changed files with 6 additions and 25 deletions

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/taskbuffer', name: '@pushrocks/taskbuffer',
version: '3.0.6', version: '3.0.7',
description: 'flexible task management. TypeScript ready!' description: 'flexible task management. TypeScript ready!'
} }

View File

@ -21,26 +21,7 @@ export interface ITaskConsultationResult {
shouldTrigger: boolean; shouldTrigger: boolean;
} }
export interface IDistributedCoordinatorConstructorOptions { export abstract class AbstractDistributedCoordinator {
/** public abstract announceDistributedDecisionInfoBasis(infoBasisArg: IDistributedDecisionInfoBasis): Promise<ITaskConsultationResult>
* each execution should be announced public abstract updateDistributedDevisionInfoBasis(infoBasisArg: IDistributedDecisionInfoBasis): Promise<void>
*/
announceDistributedDecisionInfoBasis: (distributedCoordinatorArg: DistributedCoordinator, infoBasisArg: IDistributedDecisionInfoBasis) => Promise<ITaskConsultationResult>
updateDistributedDecisionInfoBasis: (distributedCoordinatorArg: DistributedCoordinator, infoBasisArg: IDistributedDecisionInfoBasis) => Promise<void>
}
export class DistributedCoordinator {
public options: IDistributedCoordinatorConstructorOptions;
constructor(optionsArg: IDistributedCoordinatorConstructorOptions) {
this.options = optionsArg;
}
public async announceDistributedDecisionInfoBasis(infoBasisArg: IDistributedDecisionInfoBasis): Promise<ITaskConsultationResult> {
return this.options.announceDistributedDecisionInfoBasis(this, infoBasisArg);
}
public async updateDistributedDevisionInfoBasis(infoBasisArg: IDistributedDecisionInfoBasis): Promise<void> {
return this.options.updateDistributedDecisionInfoBasis(this, infoBasisArg)
}
} }

View File

@ -1,6 +1,6 @@
import * as plugins from './taskbuffer.plugins.js'; import * as plugins from './taskbuffer.plugins.js';
import { Task } from './taskbuffer.classes.task.js'; import { Task } from './taskbuffer.classes.task.js';
import { DistributedCoordinator } from './taskbuffer.classes.distributedcoordinator.js'; import { AbstractDistributedCoordinator } from './taskbuffer.classes.distributedcoordinator.js';
export interface ICronJob { export interface ICronJob {
cronString: string; cronString: string;
@ -9,7 +9,7 @@ export interface ICronJob {
} }
export interface ITaskManagerConstructorOptions { export interface ITaskManagerConstructorOptions {
distributedCoordinator?: DistributedCoordinator distributedCoordinator?: AbstractDistributedCoordinator
} }
export class TaskManager { export class TaskManager {