smartspawn/dist/smartipc.classes.thread.d.ts

26 lines
696 B
TypeScript
Raw Normal View History

2017-01-29 22:41:26 +00:00
import { Pool } from './smartipc.classes.pool';
2017-03-04 10:40:32 +00:00
export declare let workerBasePath: string;
2017-01-29 19:50:36 +00:00
export declare let setWorkerBasePath: (basePathArg: string) => void;
export declare class Thread {
thread: any;
2017-01-29 22:41:26 +00:00
workerPath: string;
running: boolean;
assignedPool: Pool;
2017-01-29 19:50:36 +00:00
constructor(filePathArg: string);
/**
* sends a message to the spawned process
2017-03-03 19:52:23 +00:00
* spawns it and keeps running
2017-01-29 19:50:36 +00:00
*/
send<T>(message: any): Promise<T>;
2017-03-03 19:52:23 +00:00
/**
* sends a command once and then kills the child process
*/
sendOnce<T>(message: any): Promise<T>;
/**
* kills the thread
*/
2017-01-29 19:50:36 +00:00
kill(): void;
2017-01-29 22:41:26 +00:00
assignToPool(poolArg: Pool): void;
private checkSpawn();
2017-01-29 19:50:36 +00:00
}