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

26 lines
696 B
TypeScript
Raw Normal View History

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