-
Notifications
You must be signed in to change notification settings - Fork 28
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
Extended return type of invokeAction() #555
Comments
That would not be a good design - how do you write use code, to use both? |
we have this cascade:
it can be modeled as a Given that |
To me it seems it's not a plain response path, you may have business logic dependent on the return patterns, therefore it is best exposed as an interface of its own, serving the results/errors. If we'd have one-shot responses, then we could use Promises to track them, otherwise we need events to report state, and success / error information. So the flow seems to be:
|
To continue the discussion I would like to summarize what has been discussed so far.
How to we deal with additionalResponses? BTW, we don't have support for it in the case of property also. Maybe we need to re-think it a bit in a broader sense. What I don't like about the proposal:
|
Hmm, I wonder if it could make sense to introduce a separate method for only invoking asynchronous actions? Or would that be overkill? |
Mhh, I don't think this can work out in all cases. The Anyhow, I think it is much more flexible that the entry point of an |
These are valid. But the TD spec has changed in this regard since the current API was designed, so the break was warranted. We need to update the API to properly model the interactions, rather than patching it up. In order to keep backward compatibility, I wonder if extending the Therefore I suggest we experiment with extending the When the When the When the |
I think that sounds pretty good actually and should also fit in quite well with the current shape of Would it make sense to create something like an |
Both could work, subclassing is cleaner, we can discuss these. Also need to check the other interactions. Error could expose an array of { error code, message and time stamp}, if error history is desired. |
This seems heading towards a nice direction 👍 I would favor extending |
I like extending
Consider that even if TDs specify multiple success answers, clients always get at most one success answer. At least this is how I interpret the current specification. The same goes for errors. About |
When designing API [extentions], we should also take into account the TD action affordance, i.e. whether it's Also, additionalResponses in a form are a complication for the API. The intent described in the TD spec confine the usage to reporting multiple success codes or errors. If the affordance can receive updates after completion, and scripts want to handle the updating process themselves, then we need to expose it via the API. But then an event / subscription based design is needed with multiple |
Based on the discussion in eclipse-thingweb/node-wot#1279 two points/issues arose. One is the following.
At the moment the
invokeAction(DOMString actionName, ...)
call may returnInteractionOutput
only. Doing so makes it difficult to properly handle long running actions that MAY report first an "ActionStatus" object that allows for cancelling/querying action.The idea/proposal is to enhance the return type. Something like
Promise<InteractionOutput | ActionStatus > invokeAction(DOMString actionName, ...)
We need to define what
ActionStatus
might be and what can be supported.I wonder whether we can define/collect fist ideas how
ActionStatus
could look like and we could also start experimenting with it implementation- wise. Is it possible to "label" such a feature "Experimental" so that it is clear it might change?Note: The EXI Profile has also an ActionStatus object and we should make it clear that it is something else. Maybe we might also use another name...
realtes to #335
The text was updated successfully, but these errors were encountered: