electron/browser/api/lib/ipc.coffee

18 lines
489 B
CoffeeScript
Raw Normal View History

EventEmitter = require('events').EventEmitter
send = process.atomBinding('ipc').send
class Ipc extends EventEmitter
constructor: ->
process.on 'ATOM_INTERNAL_MESSAGE', (args...) =>
2013-04-23 12:57:14 +00:00
@emit(args...)
2013-04-23 13:52:19 +00:00
process.on 'ATOM_INTERNAL_MESSAGE_SYNC', (args...) =>
@emit(args...)
send: (processId, routingId, args...) ->
@sendChannel(processId, routingId, 'message', args...)
sendChannel: (args...) ->
2013-04-23 12:57:14 +00:00
send('ATOM_INTERNAL_MESSAGE', args...)
module.exports = new Ipc