Last active
September 16, 2015 22:09
-
-
Save sapandiwakar/0b6ad79dc5ae5cbcf9a7 to your computer and use it in GitHub Desktop.
Cannot use `setImmediate` in electron child process
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
process.on('message', function (message) { | |
setImmediate(function() { | |
console.log(message.message); | |
}); | |
}); |
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
<html> | |
<head> | |
<title>Test</title> | |
</head> | |
<body> | |
<script src="index.js"></script> | |
</body> | |
</html> |
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
var ps = require('child_process'), | |
path = require('path') | |
this.process = ps.fork(path.join(__dirname, 'child.js')); | |
this.process.send({ | |
message: 'test' | |
}); |
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
var app = require('app'), | |
BrowserWindow = require('browser-window'), | |
path = require('path'), | |
_this = this; | |
app.on('ready', function () { | |
_this.mainWindow = new BrowserWindow({ | |
width: 800, | |
height: 600, | |
show: true | |
}); | |
_this.mainWindow.loadUrl(path.join('file://', __dirname, 'index.html')); | |
_this.mainWindow.on('closed', function () { | |
_this.mainWindow = null; | |
}); | |
}); |
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
<html> | |
<head> | |
<title>Test</title> | |
</head> | |
<body> | |
<script src="index.js"></script> | |
</body> | |
</html> | |
Submit new issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The content of package.json is incorrect (it seems like a copy of index.html).