MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / onFinish

Function onFinish

lib/client.js:745–766  ·  view source on GitHub ↗
(err, result)

Source from the content-addressed store, hash-verified

743 // usage reasonable.
744 const resultStream = new types.ResultStream({ objectMode: 1 });
745 function onFinish(err, result) {
746 if (err) {
747 resultStream.emit('error', err);
748 }
749 if (result && result.nextPage ) {
750 // allows for throttling as per the
751 // default nodejs stream implementation
752 resultStream._valve(function pageValve() {
753 try {
754 result.nextPage();
755 }
756 catch( ex ) {
757 resultStream.emit('error', ex );
758 }
759 });
760 return;
761 }
762 // Explicitly dropping the valve (closure)
763 resultStream._valve(null);
764 resultStream.add(null);
765 callback(err);
766 }
767 let sync = true;
768 this.eachRow(query, params, options, function rowCallback(n, row) {
769 resultStream.add(row);

Callers 1

client.jsFile · 0.85

Calls 2

_valveMethod · 0.80
addMethod · 0.65

Tested by

no test coverage detected