Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit stream events in stream_connection.ts
When using the managedwriter, I found that the connection often needs to reconnect, but my calling code was unable to determine when this happens. My workaround hack was to do `(stream as any)._connection.on('close', ...` and to reregister the listener every time the connection changes, but it would be great to listen to an event directly. In this commit I have forwarded the various events from the underlying connection, except 'close' is only called when the stream_connection has been instructed to close, and a new event 'reconnect' is emitted when the stream has been closed and reopened.
- Loading branch information