code: function reopen(that, err) {  // {{{2
  /*
   * Called  when the link to the the master is closed.
   */
  
    var entry = that.subject;
    if (! entry || entry.master !== that) return;
    if (entry.isGone()) return;
  
    if (err && err.code === 'ENTRY_DELETED') {
      return entry.remove(err);
    }
  
    delete entry.master;
  
    if (entry.subjectState === entry.SUBJECT_STATE.INIT) {
      if (entry.kind) {
        entry.setup();
        return doit();
      }
  
      return entry.remove(err);
    }
  
    return doit();
  
    function doit() {
      if (! entry.slaves) {
        return entry.setMasterState(entry.MASTER_STATE.GONE);
      }
  
      entry.setMasterState(entry.MASTER_STATE.WAITING);
      for (var key in entry.slaves) {
        var slave = entry.slaves[key];
        if (O.link.canSend(slave)) {
          O.link.send(slave, 'home', false);
        }
      }
  
      O.async.setImmediate(function() {
        switch (entry.shard.masterState) {
        case entry.MASTER_STATE.HOME:
        case entry.MASTER_STATE.MASTER:
          if (entry.master) return;
  
          return entry.setBusy(function(err) {
            if (err) return;
  
            if (entry.master || ! entry.slaves) {
              return entry.setReady();
            }
  
            new O.exports(entry);
            return;
          });
        case entry.MASTER_STATE.WAITING:
          return;
        }
      });
    }
  }
docs: Private {{{1