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

EdgeHub: Process Subscriptions on device connect event #455

Merged
merged 7 commits into from
Oct 19, 2018

Conversation

varunpuranik
Copy link
Contributor

EdgeHub processes subscriptions for connected clients when the device connectivity is restored. Earlier, this was done on the CloudConnectionEstablished callback, which is per cloud connection. With the latest changes, since the CloudConnection is closed when the device loses connectivity, if the client has no active upstream communication but valid subscriptions, those will never be re-processed.
So now we handle this on the DeviceConnected event.

Same logic for refreshing Device scope identities cache as well.

@varunpuranik varunpuranik force-pushed the varunpuranik/fixSubs1 branch from b4a6970 to ad85c22 Compare October 18, 2018 13:31
myagley
myagley previously approved these changes Oct 18, 2018
try
{
Events.ProcessingSubscriptions(identity);
await this.ProcessSubscriptions(identity.Id);
IEnumerable<IIdentity> connectedClients = this.connectionManager.GetConnectedClients();
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we ToList this to get a consistent snapshot? Is it possible for the IEnumerable from the GetConnectedClients to change while iterating?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Emm, it could.. let me add ToList()

@varunpuranik varunpuranik merged commit d8b9038 into master Oct 19, 2018
@varunpuranik varunpuranik deleted the varunpuranik/fixSubs1 branch October 19, 2018 21:55
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.

2 participants