Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
463b4db091 | |||
66f463549d | |||
ea47e1afc0 | |||
68132b996b |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartipc",
|
"name": "@pushrocks/smartipc",
|
||||||
"version": "1.0.5",
|
"version": "1.0.7",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartipc",
|
"name": "@pushrocks/smartipc",
|
||||||
"version": "1.0.5",
|
"version": "1.0.7",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "node inter process communication",
|
"description": "node inter process communication",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -30,7 +30,7 @@ tap.test('should create a client', async tools => {
|
|||||||
clientIpc.sendMessage('hi', { awesome: 'yes' });
|
clientIpc.sendMessage('hi', { awesome: 'yes' });
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should terminate the smartipc process', async (tools) => {
|
tap.test('should terminate the smartipc process', async tools => {
|
||||||
await tools.delayFor(1000);
|
await tools.delayFor(1000);
|
||||||
await clientIpc.stop();
|
await clientIpc.stop();
|
||||||
await serverIpc.stop();
|
await serverIpc.stop();
|
||||||
|
@ -53,7 +53,7 @@ export class SmartIpc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const handler of this.handlers) {
|
for (const handler of this.handlers) {
|
||||||
ipcEventEmitter.on(handler.keyword, (dataArg) => {
|
ipcEventEmitter.on(handler.keyword, dataArg => {
|
||||||
handler.handlerFunc(dataArg);
|
handler.handlerFunc(dataArg);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -65,10 +65,10 @@ export class SmartIpc {
|
|||||||
public async stop() {
|
public async stop() {
|
||||||
switch (this.options.type) {
|
switch (this.options.type) {
|
||||||
case 'server':
|
case 'server':
|
||||||
this.ipc.server.stop();
|
this.ipc.server.stop();
|
||||||
break;
|
break;
|
||||||
case 'client':
|
case 'client':
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
plugins.smartdelay.delayFor(2000).then(() => {
|
plugins.smartdelay.delayFor(2000).then(() => {
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
|
Reference in New Issue
Block a user