packages/grpc-native-core/src/server.js
function readCallback(err, event) {
    if (err) {
      self.terminate();
      return;
    }
    if (self.finished) {
      self.push(null);
      return;
    }
    var data = event.read;
    var deserialized;
    try {
      deserialized = self.deserialize(data);
    } catch (e) {
      e.code = constants.status.INTERNAL;
      self.emit('error', e);
      return;
    }
    if (self.push(deserialized) && data !== null) {
      var read_batch = {};
      read_batch[grpc.opType.RECV_MESSAGE] = true;
      self.call.startBatch(read_batch, readCallback);
    } else {
      self.reading = false;
    }
  }
function readCallback(err, event) {
    if (err) {
      self.terminate();
      return;
    }
    if (self.finished) {
      self.push(null);
      return;
    }
    var data = event.read;
    var deserialized;
    try {
      deserialized = self.deserialize(data);
    } catch (e) {
      e.code = constants.status.INTERNAL;
      self.emit('error', e);
      return;
    }
    if (self.push(deserialized) && data !== null) {
      var read_batch = {};
      read_batch[grpc.opType.RECV_MESSAGE] = true;
      self.call.startBatch(read_batch, readCallback);
    } else {
      self.reading = false;
    }
  }
function readCallback ( err , event ) { if ( err ) { self . terminate ( ) ; return ; } if ( self . finished ) { self . push ( null ) ; return ; } var data = event . read ; var deserialized ; try { deserialized = self . deserialize ( data ) ; } catch ( e ) { e . code = constants . status . INTERNAL ; self . emit ( 'error' , e ) ; return ; } if ( self . push ( deserialized ) && data !== null ) { var read_batch = { } ; read_batch [ grpc . opType . RECV_MESSAGE ] = true ; self . call . startBatch ( read_batch , readCallback ) ; } else { self . reading = false ; } }
Callback to be called when a READ event is received. Pushes the data onto
the read queue and starts reading again if applicable
@param {grpc.Event} event READ event object
Callback to be called when a READ event is received . Pushes the data onto the read queue and starts reading again if applicable