@tripod311/leg5
Version:
Zero-dependency concurrent function execution for Node.js using worker threads.
23 lines (22 loc) • 636 B
TypeScript
export default class Task {
private _name;
private _script;
private _argsList;
private _args;
private _timeout;
private _canceled;
private _cancelFunction?;
private _promise;
constructor(name: string, script: string, argsList: string[], args: Record<string, any>, timeout: number);
get name(): string;
get script(): string;
get argsList(): string[];
get timeout(): number;
get args(): any;
get promise(): Promise<any>;
get canceled(): boolean;
assign(cancelFunction: () => void): void;
cancel(): void;
finish(result: any): void;
fail(reason: any): void;
}