-
Notifications
You must be signed in to change notification settings - Fork 63
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 subscribeallevents
and unsubscribeallevents
operations
#1082
Comments
Just for precision, when the Another point, when I am subscribed to a single event and then execute |
Good question. Actually it probably makes more sense to just receive individual events as they are emitted, because it's not clear what data would be provided for the other event types in that payload. I didn't know that's how
I would assume the former, since otherwise Some of these details may require some prototyping in different protocols (e.g. SSE, WebSockets, longpoll, webhooks) to iron out because we may come up against limitations in certain protocols. |
Actually, you might still need to define a way to include the name of the event in the event payload (e.g. wrap the event in an object, keyed by event name), since otherwise the consumer might not know to which type the event belongs. |
@benfrancis wrote:
I agree that this kind of a payload scheme is needed. Thank you for clearing up the other points. Regarding |
About the payload, I think we should prescribe a particular In general, those operations feel quite tight up to the specific protocol in use. What do you think? |
I think we need an explanation at least. Also having 9 photo properties and 1 JSON is possible :) So the main reason these were added at the time was that there were APIs that supported this and we had no way of describing them properly. I think it was @mlagally 's contribution thus I think it is best to ask him. @mlagally how does the Oracle API behave when there are properties that are not of the same type as the others or are they always the same type? |
I've submitted a pull request for this in #1191. Regarding the event payload data schema, my conclusion is that this will need to be protocol specific. A couple of examples: Server Sent Events The data stream format for Server Sent Events defines its own mechanism for serialising the names of named events. E.g. An overheated event defined a Thing Description as follows...
...could be serialised with the event name in the
WebSockets WebSockets on the other hand do not have such a mechanism, so this would need to be defined in a sub-protocol. E.g. the event could be serialised in JSON with the event name and data as properties of an object:
For the Core Profile in the WoT Profile specification I'm going to propose that the Sever Sent Events example be used, and this serialisation can be defined in the protocol binding section of the profile. |
Add subscribeallevents and unsubscribeallevents operations - closes #1082
In #133 we discussed how the current wot-discovery draft provides an example Thing Description for the Directory Service API which combines three different event types (
created_td
,updated_td
anddeleted_td
) into a singleregistration
event such that a consumer can subscribe and unsubscribe to all three events at once.This feels like a workaround for a missing feature in the Thing Description specification which enables consumers to subscribe to all events or unsubscribe from all events in a single operation. I would therefore like to propose new
subscribeallevents
andunsubscribeallevents
operations to fulfill this requirement.I suggest these should be form operations which can be used on a top level form, similar to how
readallproperties
andwriteallproperties
currently works.There would need to be some normative statements in the specification like there currently is for
readallproperties
andwriteallproperties
which describe what the payload for such resources should look like (i.e. a concatenation of the individual event interaction payloads, keyed by event namee.g. including the name of the event in the event payload). (See comment below).See also: This is related to the
readallpastevents
operation proposed in #892 (comment) for event logs.The text was updated successfully, but these errors were encountered: