-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand WebSockets event listener capabilities
Closes #311. Adds responding to WebSockets ping messages during the attempt to fetch the next event from the event stream. I debated whether or not to wrap the fetching of the next message in a finite or an infinite loop, but wrapping it in a finite loop would just push that same responsibility further up the stack. Using this approach allows us to do away with the optionality of a `ResultEvent` and simplifies the method signature. Also, I added in a `close` method for the listener to allow one to gracefully close the connection (avoids those ugly `websocket: close 1006 (abnormal closure): unexpected EOF` messages in the Tendermint logs). Signed-off-by: Thane Thomson <connect@thanethomson.com>
- Loading branch information
1 parent
02fa831
commit ba0674e
Showing
2 changed files
with
89 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters