-
Notifications
You must be signed in to change notification settings - Fork 8
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
[HTTP Basic Profile] Require that async actions set the synchronous member of an ActionAffordance to false #405
Comments
Doesn't this contradict the goal of simplifying WoT development. That is quite a complex behavior. I think it would be just much simpler if profile mandates defining the synchronous keyword. |
I agree. It's a shame that the synchronous member doesn't have a default value in the Thing Description specification, but maybe that wouldn't make sense for all protocols. I think we were just following the Thing Description specification which says "Lack of this keyword means that no claim on the synchronicity of the action can be made." but on reflection this just makes things more difficult for Consumers. |
The reason for that was that both ways are a claim. The other keys with defaults have a default since the default is the "safer" way.
This is indeed the case and a TD producer should have a value for this. If needed, this can be made more assertive in TD 2.0. Making it mandatory would have invalidated all previous TDs. |
@danielpeintner Ooh, good catch. The term I have filed #410. |
Currently the HTTP Basic Profile says:
This might cause a generic WoT Consumer which doesn't implement the profile to get confused if it invokes an action, expects a synchronous response containing the action output, but actually gets an asychronous response with an ActionStatus payload linking to a dynamic resource.
We could consider asserting that if a Thing implements an asynchronous action then it must set the synchronous member of the ActionAffordance to false, to be more explicit that it will not respond synchronously.
This should then be enough to tell a generic Consumer not to expect the action output in the response to the invokeaction request, even if it can't then consume the queryaction and cancelaction operations.
Currently it's technically possible that the same action affordance to respond either synchronously or asynchronously depending on the anticipated duration of the action, and for a sufficiently sophisticated Consumer to understand both responses. This change would remove that flexibility in favour of more predictable behaviour, and a "progressive enhancement" approach. Consumers which don't support asynchronous actions can either "fire and forget" an action invocation, or ignore an asynchronous ActionAffordance altogether.
The text was updated successfully, but these errors were encountered: