Skip to content

Commit 5c91b27

Browse files
committed
Terminate streams with an empty record
1 parent 3aba9a3 commit 5c91b27

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/streams.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ function OutputStream(conn, id, recordType) {
6868
this._id = id;
6969

7070
this._open = true;
71+
72+
this.on('finish', function () {
73+
this._conn.stream.writeRecord(
74+
this._id,
75+
new this.recordType());
76+
});
7177
}
7278
util.inherits(OutputStream, stream.Writable);
7379

@@ -147,6 +153,12 @@ function IOStream(conn, id, recordType) {
147153
this._id = id;
148154

149155
this._open = true;
156+
157+
this.on('finish', function () {
158+
this._conn.stream.writeRecord(
159+
this._id,
160+
new this.recordType());
161+
});
150162
}
151163
util.inherits(IOStream, stream.Duplex);
152164

0 commit comments

Comments
 (0)