-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
This may relate to my inexperience with streams, but I would expect the my simple test app to terminate after consuming the "finish" stream event? I know I can call process.exit, but the fact that it doesn't exit concerns me that some resource (request socket?) is being left open (and could accumulate/leak on subsequent calls?)
let gmail = new Gmail(ACCESS_TOKEN);
let stream = gmail.messages('label:inbox', { max: 10, fields: ['id', 'labelIds', 'snippet'] });
stream.on('data', (message) => {
console.log(JSON.stringify(data));
});
stream.on('finish', () => {
console.error('## PROCESS STAYS RUNNING ##');
});
I see the retrieve method calls combined.end() so I can't figure out why the process doesn't exit after the stream is closed.
Metadata
Metadata
Assignees
Labels
No labels