-
Notifications
You must be signed in to change notification settings - Fork 28
[ExposedThing] Not possible to handle property observations in Scripting level #211
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
Comments
What is the use case to handle observerCount? The only thing needed is registering a request handler. partial interface ExposedThing {
Promise<void> setPropertyObserveHandler(DOMString name, PropertyReadHandler handler);
Promise<void> setPropertyUnobserveHandler(DOMString name, PropertyReadHandler handler);
}; The signature is the same as for |
I have made these changes, but have doubts about do we really need script defined handlers for subscriptions. When writing the algorithms, I realized that implementations can trivially do/generate the code for that, which is the reason these have not been included from the start. So we need to check if we have the same understanding on how observe should be implemented and what is the value to open a hook for apps. |
On the Scripting call on 20. April 2020, we clarified that these handlers would not just extend default handling, but completely define it. |
…hing; fixes w3c#210 and w3c#211 Signed-off-by: Zoltan Kis <[email protected]>
Fixed by #218 |
Similar to Issue #210
Use case: A reverse proxy implementation consumes a physical Thing in a local network and reexposes it as a new virtual ExposedThing to another network. A consumer of the virtual ExposedThing starts observing a property. The issue is that there is no way to detect and handle a new observer so that the proxy can start observing a property in the physical Thing. A non-optimal solution is to observe properties of the physical Thing in the beginning (without any subscription) and write new values into the properties of the virtual ExposedThing, which results in the new values being sent to the Consumer.
Proposal: Create two new methods in the ExposedThing interface, one to handle the
observeproperty
operation and one to handleunobserveproperty
. These could be similar to setPropertyReadHandler. Example:setPropertyObserveHandler(propertyName, ? observerCount): This could also solve the handling of subscription payloads. A subscription count would be interesting if the implementation wants to limit the number of subscriptions due to resource
setPropertyUnobserveHandler(eventName, ? observerCount): Similar to the above
The text was updated successfully, but these errors were encountered: