Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Manage context-unavailable notification #105

Open
lferrandis opened this issue Jun 26, 2013 · 0 comments
Open

Manage context-unavailable notification #105

lferrandis opened this issue Jun 26, 2013 · 0 comments

Comments

@lferrandis
Copy link
Contributor

For instance, we only manage 'context-available' notification.

We rely on 'device-proxy-available' & 'device-proxy-unavailable' to manage devices and the list of context for each devices. It's in this notification we manage

We could make code more simple and more clear by splitting the current in 2 pieces, and probably faster, as we could manage the drop of a context in a single notification, rather than to wait a device-proxy-unavailable notification by device avaible on this context.

This enhancement will probably not introduce too much change in the code. It's seems it's more a reorg of the current code, plus some new code for the new notification context-unavailable.

The code for context-available should remain the same.

The code for context-unavailable should parse all devices to find the one that belong to the context and remove it from the list (device->context). If the list is empty, the device is deleted. If the deviec has subscribed for event notification on that context, try to register on another context. All this code already exists.

The code for device-proxy-available should remain the same.

The code for device-proxy-unavailable should be remain almost the same. Just removing things that belong to context, like re-registering for event notification.

This will also clarify the code in notification. When we will receive device-proxy-unavailable it will be for a server that has shutdown, not because a context has dropped. So we will be able to clear immediately a device.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant