fix(core): update
This commit is contained in:
parent
973678d635
commit
4d2756b743
@ -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!'
|
||||||
}
|
}
|
||||||
|
@ -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)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user