-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Labels
api: bigtableIssues related to the googleapis/nodejs-bigtable API.Issues related to the googleapis/nodejs-bigtable API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
This is copied from a stackoverflow question:
I want to process data from BigTable table in a stream, but end stream early. I am using this code for Node.js (slightly modified https://github.com/googleapis/nodejs-bigtable/blob/master/samples/document-snippets/table.js#L215):
const stream = new BigTable({projectId, keyFilename})
.instance(instanceId)
.table(tableName)
.createReadStream();
stream.on('data', () => {
stream.end();
});
stream.on('end', () => {
console.log('end');
stream.destroy();
});
stream.on('close', () => {
console.log('close');
});Output is:
end
closeBut the process is not yet finished. So, i believe that some resources are not closed. How should i stop stream and close relevant resources?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: bigtableIssues related to the googleapis/nodejs-bigtable API.Issues related to the googleapis/nodejs-bigtable API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.