taskbuffer/dist/taskbuffer.classes.taskmanager.d.ts

45 lines
1.2 KiB
TypeScript

import { Task } from './taskbuffer.classes.task';
import { Objectmap } from 'lik';
export declare class TaskManager {
taskMap: Objectmap<Task>;
private cronJobMap;
constructor();
/**
* checks if a task is already present
* @param taskNameArg
*/
getTaskByName(taskNameArg: any): Task;
/**
* adds a Task to the TaskManager
* @param taskArg
*/
addTask(taskArg: Task): void;
/**
* adds and schedules a task at once
* @param taskArg
* @param cronStringArg
*/
addAndScheduleTask(taskArg: Task, cronStringArg: string): void;
/**
* triggers a task in the TaskManagerByName
* @param taskNameArg
*/
triggerTaskByName(taskNameArg: string): Promise<any>;
/**
* schedules the task by name
* @param taskNameArg
*/
scheduleTaskByName(taskNameArg: string, cronStringArg: string): void;
descheduleTaskByName(taskNameArg: string): void;
/**
* returns all schedules of a specific task
* @param taskNameArg
*/
getSchedulesForTaskName(taskNameArg: string): void;
}
export interface ICronJob {
cronString: string;
taskNameArg: string;
job: any;
}