packages/grpc-native-core/src/server.js
function handleClientStreaming(call, handler, metadata) {
  var stream = new ServerReadableStream(call, metadata, handler.deserialize);
  stream.on('error', function(error) {
    handleError(call, error);
  });
  stream.waitForCancel();
  handler.func(stream, function(err, value, trailer, flags) {
    stream.terminate();
    if (err) {
      if (trailer) {
        err.metadata = trailer;
      }
      handleError(call, err);
    } else {
      sendUnaryResponse(call, value, handler.serialize, trailer, flags);
    }
  });
}
function handleClientStreaming(call, handler, metadata) {
  var stream = new ServerReadableStream(call, metadata, handler.deserialize);
  stream.on('error', function(error) {
    handleError(call, error);
  });
  stream.waitForCancel();
  handler.func(stream, function(err, value, trailer, flags) {
    stream.terminate();
    if (err) {
      if (trailer) {
        err.metadata = trailer;
      }
      handleError(call, err);
    } else {
      sendUnaryResponse(call, value, handler.serialize, trailer, flags);
    }
  });
}
function handleClientStreaming ( call , handler , metadata ) { var stream = new ServerReadableStream ( call , metadata , handler . deserialize ) ; stream . on ( 'error' , function ( error ) { handleError ( call , error ) ; } ) ; stream . waitForCancel ( ) ; handler . func ( stream , function ( err , value , trailer , flags ) { stream . terminate ( ) ; if ( err ) { if ( trailer ) { err . metadata = trailer ; } handleError ( call , err ) ; } else { sendUnaryResponse ( call , value , handler . serialize , trailer , flags ) ; } } ) ; }
User provided method to handle client streaming methods on the server.
@callback grpc.Server~handleClientStreamingCall
@param {grpc~ServerReadableStream} call The call object
@param {grpc.Server~sendUnaryData} callback The callback to call to respond
to the request
 
Fully handle a client streaming call
@access private
@param {grpc.internal~Call} call The call to handle
@param {Object} handler Request handler object for the method that was called
@param {grpc~Server.handleClientStreamingCall} handler.func The handler
function
@param {grpc~deserialize} handler.deserialize The deserialization function
for request data
@param {grpc~serialize} handler.serialize The serialization function for
response data
@param {grpc.Metadata} metadata Metadata from the client
User provided method to handle client streaming methods on the server .