-
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
how to find the Form pair for an operation, e.g. the unsubscribe Form for a given subscribe Form #968
Comments
To make it even clearer. How do you know:
|
I have a feeling that if we want to really solve this properly, we need to explicitly tell the form associated with a form's operation. Something like: {
//...
"forms": [{
"op": "subscribeevent",
"href" : "http://mytemp.example.com:5683/temp",
"contentType": "application/json",
"htv:methodName": "POST",
"unsubscribeevent":{ //this should be probably something else
"op": "unsubscribeevent", //somewhat duplicate
"href" : "http://mytemp.example.com:5683/temp",
"contentType": "application/json",
"htv:methodName": "DELETE",
}]
//...
} |
I said the same in the Scripting call, i.e. either link/reference/index the unsubscribe Form, or specify them as a tuple. |
I like @egekorkan proposal. Maybe this can be also a direction that can be used for the topic with hypermedia #899 |
Perhaps instead of |
Just stumble again on this issue while implementing the new ConsumedThing subscription API for node-wot: eclipse-thingweb/node-wot#585. In my opinion, the only viable solution to make a clear and consistent algorithm is @egekorkan's proposal, to have a pair of subscribe/unsubscribe forms. IMHO, this feature is currently pretty broken cause a consumer would have a hard time understanding the right form to use once it has a subscription already in place. For TD 1.1 we can introduce a new keyword to at least stem the issue, but probably a more consistent approach might be beneficial to solve also the new Action model. @egekorkan @sebastiankb can we add this issue to the next agenda? should it be deferred? |
Better to defer it I think since this is indeed a discussion requiring issue. Regarding requiring them as pairs in an op is that if I do In any case, it is a rather interesting issue and treating subscriptions the same way as handling actions seems like a usable idea. In the end, cancelling an action can be considered analogous to unsubscribing from an event |
Indeed, in the Scripting API we were discussing to use the same interface for both Subscriptions and async Actions, there definitely a pattern. I could factor out something 🤔 . |
@danielpeintner wrote:
I guess this depends on the protocol or sub-protocol being used. For Server-Sent Events an The same is probably true for long-polling where an For WebSub, the For WebSockets it would be inefficient to use a separate socket for each event subscription and unsubscription, so in that case an existing open connection is also likely to be used for an In general if there's only one form for an This seems like a specialised case of the more general problem of how a Consumer should select from multiple forms for any given operation, for which there isn't currently any specific guidance in the specification. I've proposed "Define an algorithm for parsing a Thing Description" as a potential deliverable for the next charter in order to resolve these kinds of ambiguities.
Eesh, yes that does get complicated. |
To me, what is missing is a clear information in the TD on each observe about
|
I am adding v1.1 since we can at least add an informative warning-like text |
from today's TD call:
|
Coming from #957 and the need for an algorithm in Scripting PR 264, please identify the mechanism to obtain the Form pair for a given operation.
The text was updated successfully, but these errors were encountered: