-
Notifications
You must be signed in to change notification settings - Fork 28
Do we need an EventHandler? #408
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
Call 2022-07-04
|
I am not 100% sure but this was about implementing a shadow thing or a proxy. I am proxying a local thing to the public network and before having this event handler, the proxy would subscribe to all events even if there is no consumer of the proxy interested in some of the events. With the event handler, when a subscription request comes to the proxy, it will subscribe in the event handler. However, I think I am not seeing something since in my point of view, there is no difference in an event having data or not. |
The issue @egekorkan is mentioning is #211. I "think" the issue is the same for events and observing property changes... |
Call 2022-07-11 |
I can join next week. I think that I have confused it with eventsubscription handler |
Call 2022-07-18
|
Let's record the justification in more detail, please. I wonder if we all mean the same things and use cases about this EventHandler.
So far the handler for handling events in ExposedThing has been defined by a user-defined function. So are we now saying that:
I'd say if there are no strong use cases for the EventHandler hook on ExposedThing, we should indeed remove it, to simplify the spec. |
Call 2022-08-08
|
In the Handling Events flow, we are stating that if
data
isnull
or undefined the runtime should ask the internal sloteventHandler
to return something for sending it to the network.However, I don't think we have such a use case: a caller does not know what to send for a particular event and defers the decision to the backend logic of an ExposedThing.
This choice makes also it quite inconvenient to cover the use case described in #402. In other words, if an event has not data here's the code needed to implement it:
Whereas if we just rely on the data passed on the
emitEvent
method we could simply:The text was updated successfully, but these errors were encountered: