umbilical

Bidirectional rpc over tpc for inter-process communication pruposes and other stuff.

umbilical

Bidirectional rpc between your node.js processes.

npm install umbilical

// "Server" 
 
var umbilical = require('umbilical')
 
var server = umbilical.endpoint({port: 1337},
{ addfunction(abcb) {
    cb(null, a+b)
  }
, mulfunction(a,bcb) {
    cb(null, a*b)
  }
}
, function(client) {
 
  client.request('hello', function(erres) {
    console.log(res)
  })
 
})
// "Client" 
 
var umbilical = require('umbilical')
 
var server = umbilical({port: 1337},
{ hellofunction(cb) {
      cb(null, 'oh, be quiet, already!')
  }
})
 
server.request('mul', 5, 6, function(erres) {
  if(er) throw new er
  console.log8('5 * 6 =', res)
})

Copyright (c) Marcel Klehr

MIT License