fix(core): update
This commit is contained in:
parent
973678d635
commit
4d2756b743
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/taskbuffer',
|
||||
version: '3.0.6',
|
||||
version: '3.0.7',
|
||||
description: 'flexible task management. TypeScript ready!'
|
||||
}
|
||||
|
@ -21,26 +21,7 @@ export interface ITaskConsultationResult {
|
||||
shouldTrigger: boolean;
|
||||
}
|
||||
|
||||
export interface IDistributedCoordinatorConstructorOptions {
|
||||
/**
|
||||
* each execution should be announced
|
||||
*/
|
||||
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)
|
||||
}
|
||||
|
||||
export abstract class AbstractDistributedCoordinator {
|
||||
public abstract announceDistributedDecisionInfoBasis(infoBasisArg: IDistributedDecisionInfoBasis): Promise<ITaskConsultationResult>
|
||||
public abstract updateDistributedDevisionInfoBasis(infoBasisArg: IDistributedDecisionInfoBasis): Promise<void>
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import * as plugins from './taskbuffer.plugins.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 {
|
||||
cronString: string;
|
||||
@ -9,7 +9,7 @@ export interface ICronJob {
|
||||
}
|
||||
|
||||
export interface ITaskManagerConstructorOptions {
|
||||
distributedCoordinator?: DistributedCoordinator
|
||||
distributedCoordinator?: AbstractDistributedCoordinator
|
||||
}
|
||||
|
||||
export class TaskManager {
|
||||
|
Loading…
Reference in New Issue
Block a user