Skip to content

Commit e111715

Browse files
committed
Emit 'close' events when query completes
Consider a system where one component is scheduling tasks that yield streams, and passing them to (unknown) clients for consumption. It would be useful for the scheduler to know that the query underlying the stream is completed (so it can continue on to it's next task) without having to wait for the consumer to finish reading all results.
1 parent 0ebd4c3 commit e111715

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

index.js

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ QueryStream.prototype.handleCommandComplete = function(msg) {
9898
}
9999

100100
QueryStream.prototype.handleReadyForQuery = function() {
101+
this.emit('close')
101102
this.push(null)
102103
}
103104

0 commit comments

Comments
 (0)