-
Notifications
You must be signed in to change notification settings - Fork 313
Conversation
e79abce
to
61ecec9
Compare
lib/clients/websocket.js
Outdated
this.heartbeat = heartbeat; | ||
this.channels = channels || ['full']; | ||
if (!this.channels.includes('heartbeat')) { | ||
this.channels.push('heartbeat'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heartbeats are pretty noisy, so there should be a way to disable them to save bandwidth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heartbeats are pretty noisy...
🤔 Not compared the full
or ticker
or matches
or level2
channel. The only channel that is less noisy than heartbeat
is the user
channel.
heartbeat
is mild compared to anything else, and it comes with other very useful benefits (keeps the connection open, helps address lost sequences, etc).
Also, the longer-term intent of this automatic heartbeat
addition is to eventually allow the WebsocketClient
to automatically monitor the heartbeat, reconnect as necessary, and potentially fire an event when a missed sequence is recognized. i.e. The heartbeat
does not need to necessarily propagate to the caller.
(I'll also rebase after the new conflicts.)
I like the change, just one comment |
61ecec9
to
90e884b
Compare
Rebased. Let me know if the automatic |
90e884b
to
969d10c
Compare
- Automatically adds the `heartbeat` channel if not already subscribed - Removes redundant `keepalive` ping on the socket Fixes coinbase#113
969d10c
to
ac4bda1
Compare
Rebased again to resolve new conflicts. |
Thanks a lot @rmm5t! |
heartbeat
channel if not already subscribedkeepalive
ping on the socketFixes #113