docs: function (msg) {                                                                              // 1590
      // id, result or error. error has error (code), reason, details                                               // 1591
                                                                                                                    // 1592
      var self = this;                                                                                              // 1593
                                                                                                                    // 1594
      // Lets make sure there are no buffered writes before returning result.                                       // 1595
      if (!_.isEmpty(self._bufferedWrites)) {                                                                       // 1596
        self._flushBufferedWrites();                                                                                // 1597
      }                                                                                                             // 1598
                                                                                                                    // 1599
      // find the outstanding request                                                                               // 1600
      // should be O(1) in nearly all realistic use cases                                                           // 1601
      if (_.isEmpty(self._outstandingMethodBlocks)) {                                                               // 1602
        Meteor._debug("Received method result but no methods outstanding");                                         // 1603
        return;                                                                                                     // 1604
      }                                                                                                             // 1605
      var currentMethodBlock = self._outstandingMethodBlocks[0].methods;                                            // 1606
      var m;                                                                                                        // 1607
      for (var i = 0; i < currentMethodBlock.length; i++) {                                                         // 1608
        m = currentMethodBlock[i];                                                                                  // 1609
        if (m.methodId === msg.id)                                                                                  // 1610
          break;                                                                                                    // 1611
      }                                                                                                             // 1612
                                                                                                                    // 1613
      if (!m) {                                                                                                     // 1614
        Meteor._debug("Can't match method response to original method call", msg);                                  // 1615
        return;                                                                                                     // 1616
      }                                                                                                             // 1617
                                                                                                                    // 1618
      // Remove from current method block. This may leave the block empty, but we                                   // 1619
      // don't move on to the next block until the callback has been delivered, in                                  // 1620
      // _outstandingMethodFinished.                                                                                // 1621
      currentMethodBlock.splice(i, 1);                                                                              // 1622
                                                                                                                    // 1623
      if (_.has(msg, 'error')) {                                                                                    // 1624
        m.receiveResult(new Meteor.Error(                                                                           // 1625
          msg.error.error, msg.error.reason,                                                                        // 1626
          msg.error.details));                                                                                      // 1627
      } else {                                                                                                      // 1628
        // msg.result may be undefined if the method didn't return a                                                // 1629
        // value                                                                                                    // 1630
        m.receiveResult(undefined, msg.result);                                                                     // 1631
      }                                                                                                             // 1632
    }