-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit and Publish Peer Connection Errors (#317)
* Emit & Publish Peer Connection Errors A zetta instance's `pubsub` can be used to react to peer client disconnect events. Currently, the _peer_client_ module will emit a "closed" event for both a socket error *and* socket close event. This means the zetta handle of 'error' events will never be called. This change adds `emit('error', err)` to the _peer_client_ module, and updates _zetta_ to publish the '_peer/disconnect' event with the `error` object as an additional property of the published data. `publish('_peer/disconnect'), {peer:peerClient, error: error});` This allows code that subscribes to the peer disconnect events to react specifically to errors. * Publish Error Updated _zetta_ module to publish '_peer/error' instead of disconnect on a peer client 'error' event. This should not cause an issues with existing code because the 'error' event was previously never emitted. * Update _peer_client_ to only emit the "error" event. #312 (comment) * Updated PR per @AdamMagaluk; changes to match _event_socket_ in: 6206dc5 * Added tests to ensure PeerClients emits the proper close event * Remove use of _peer/error and use only _peer/disconnect
1 parent
70334a8
commit 70312be
Showing
4 changed files
with
67 additions
and
16 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
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