-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
worker window incl. ipc - webpack changes
- Loading branch information
Raul Rosenlöcher
committed
Jun 13, 2018
1 parent
3a9259f
commit dced254
Showing
14 changed files
with
120 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
import log from 'electron-log'; | ||
import * as workerIpc from './workerIpc'; | ||
|
||
log.info("worker/index.js - loaded"); | ||
|
||
console.log("con - worker.js - loaded"); | ||
//alert("Hello! I am an alert box!!"); | ||
workerIpc.registerListener(); | ||
|
||
//const log = require('electron-log'); | ||
log.info("log - worker.js - loaded"); | ||
|
||
//import log from 'electron-log'; | ||
//log.info("worker.js - loaded"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import log from 'electron-log'; | ||
import {ipcRenderer} from 'electron'; | ||
import * as ipcKeys from "../common/ipcKeys"; | ||
|
||
// ---------------------------------------------------------------------------------- | ||
|
||
const logKey = "workerIpc-"; | ||
|
||
// ---------------------------------------------------------------------------------- | ||
|
||
export function registerListener() { | ||
//log.debug(`${logKey}registerListener`); | ||
ipcRenderer.on(ipcKeys.IPC_TGT_WORKER, listenWorkerChannel); | ||
|
||
sendToMain(ipcKeys.IPC_STATE_READY, "from_worker"); | ||
} | ||
|
||
// ---------------------------------------------------------------------------------- | ||
|
||
export function unregisterListener() { | ||
//log.debug(`${logKey}unregisterListener`); | ||
ipcRenderer.removeAllListeners(ipcKeys.IPC_TGT_MAIN); | ||
} | ||
|
||
// ---------------------------------------------------------------------------------- | ||
|
||
function listenWorkerChannel(event, input, output) { | ||
//log.debug("listenRendererChannel: event=", event, "; input=", input, "; output=", output); | ||
log.debug(`${logKey}listenWorkerChannel: input=`, input); | ||
|
||
} | ||
|
||
// ---------------------------------------------------------------------------------- | ||
|
||
export function sendToMain(ipcType, payload) { | ||
const data = { | ||
type: ipcType, | ||
payload: payload | ||
} | ||
ipcRenderer.send(ipcKeys.IPC_TGT_MAIN, data); | ||
} | ||
|
||
// ---------------------------------------------------------------------------------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters