Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

www: Update wsDcrdata context #933

Merged
merged 2 commits into from
Jun 25, 2019
Merged

www: Update wsDcrdata context #933

merged 2 commits into from
Jun 25, 2019

Conversation

lukebp
Copy link
Member

@lukebp lukebp commented Jun 25, 2019

This diff pulls the dcrdata websocket functionality out of the cms address watcher implementation and creates a general abstraction for managing dcrdata websocket connections.

It also updates the cms address watcher naming convention to make a distinction between cms address watching and the pi paywall functionality, which will both use dcrdata websocket subscriptions for address events.

This diff pulls the dcrdata websocket functionality out of the cms
address watcher implementation and creates an abstraction that can be
used to manage dcrdata websocket connections.
if p.pubSubDcrdata != nil && p.pubSubDcrdata.client != nil {
p.pubSubDcrdata.client.Stop()
// Shutdown all dcrdata websockets
if p.wsDcrdata != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need to verify that p.wsDcrdata.client is not nil here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because wsDcrdata is initialized using the function newWSDcrdata, which ensures that the client is setup correctly. If it's being initialized without using newWSDcrdata then its being initialized incorrectly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool thanks for clarifying. Looks good.

Copy link
Member

@marcopeereboom marcopeereboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@lukebp lukebp merged commit babeb92 into decred:master Jun 25, 2019
@lukebp lukebp deleted the wsdcrdata branch June 16, 2020 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants