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

Add Subscription status change handler; fix AppSyncMQTTClient data races #196

Merged
merged 2 commits into from
Mar 11, 2019

Conversation

palpatim
Copy link
Contributor

@palpatim palpatim commented Mar 8, 2019

  • Added statusChangeHandler to AppSyncClient's subscribe method to provide status updates.
  • Added verbose logging around subscription connections
  • Cancel streams and reconnect threads on disconnect

Issue #, if available:
#42
#184

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@palpatim palpatim added AppSync contribution Community contribution PRs labels Mar 8, 2019
@palpatim palpatim requested a review from scb01 March 8, 2019 04:29
@palpatim palpatim changed the title Fixed AppSyncMQTTClient data races (#184) Add Subscription status change handler; fix AppSyncMQTTClient data races Mar 8, 2019
- Fixed AppSyncMQTTClient data races (#184)
- Added `statusChangeHandler` to AppSyncClient's `subscribe` method to provide status updates.
- Added verbose logging around subscription connections
- Cancel streams and reconnect threads on disconnect
@palpatim palpatim force-pushed the palpatim/subscription-and-mqtt-fixes branch from fdd8679 to fc11da2 Compare March 8, 2019 04:36
connectedCallback?()
}

func messageCallbackDelegate(data: Data) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This method should include a check to validate that the subscription is not canceled.

let clientsWithNoTopics = self.removeClientsWithNoTopics()

// Send the `disconnect` on the subscriptions queue since we don't need it for internal consistency
self.subscriptionsQueue.async {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider sending this work to a "utility" QOS dispatch queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution Community contribution PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants