code: function bridgeCommand(command,cb){
      if(!connected) return setImmediate(function(){
        cb('killed');
      });
  
      if(!connected.pings) connected.pings = {};
      var id = ++pingid;
      var timer;
      connected.pings[id] = function(err,data){
        clearTimeout(timer);
        delete connected.pings[id]
        cb(err,data);
      };
      connected.send({command:command,cb:id});
      // set 5 second time limit for callback.
      timer = setTimeout(function(){
        cb("timeout");
      },5000);
    }
docs: rpc to worker process for commands.