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.
This commit is contained in:
Stephen Sugden 2013-12-25 13:33:34 -08:00
parent 0ebd4c3bbb
commit e1117155ae

View File

@ -98,6 +98,7 @@ QueryStream.prototype.handleCommandComplete = function(msg) {
}
QueryStream.prototype.handleReadyForQuery = function() {
this.emit('close')
this.push(null)
}