mirror of https://github.com/embarklabs/embark.git
debug console logs
This commit is contained in:
parent
1821e89346
commit
37ade68804
|
@ -28,6 +28,9 @@ class IPC {
|
|||
|
||||
on(action, done) {
|
||||
ipc.server.on('message', function(data, socket) {
|
||||
console.dir("received message");
|
||||
console.dir(action);
|
||||
console.dir(data);
|
||||
if (data.action !== action) {
|
||||
return;
|
||||
}
|
||||
|
@ -36,19 +39,29 @@ class IPC {
|
|||
}
|
||||
|
||||
reply(client, action, data) {
|
||||
console.dir("reply message");
|
||||
console.dir(action);
|
||||
console.dir(data);
|
||||
ipc.server.emit(client, 'message', {action: action, message: data});
|
||||
}
|
||||
|
||||
once(action, cb) {
|
||||
ipc.of['embark'].once('message', function(msg) {
|
||||
console.dir("once message");
|
||||
console.dir(action);
|
||||
console.dir(msg);
|
||||
if (msg.action !== action) {
|
||||
return;
|
||||
}
|
||||
console.dir('received');
|
||||
cb(msg.message);
|
||||
});
|
||||
}
|
||||
|
||||
request(action, data) {
|
||||
console.dir("request message");
|
||||
console.dir(action);
|
||||
console.dir(data);
|
||||
ipc.of['embark'].emit('message', {action: action, message: data});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue