System to handle IPC communication

This commit is contained in:
Geomitron
2020-02-03 23:24:15 -05:00
parent 95c46cad39
commit a4becd92aa
10 changed files with 150 additions and 22 deletions

View File

@@ -0,0 +1,11 @@
import { IPCHandler } from '../shared/IPCHandler'
import { TestInput } from '../shared/interfaces/test.interface'
export default class TestHandler implements IPCHandler<'test-event-A'> {
event = 'test-event-A' as 'test-event-A'
async handler(data: TestInput) {
await new Promise<void>((resolve) => setTimeout(() => resolve(), 3000))
return `Processed data with value1 = ${data.value1} and value2 + 5 = ${data.value2 + 5}`
}
}