Open relu91 opened 3 years ago
Pagination case for multiple TDs in a page should be encapsulated by the implementation. Full TD's are handed to the app one by one, by the discovery (observer) API. This should be already covered.
Pagination case for TD split in multiple page is open issue and it's being discussed in #309. Depending on the WoT runtime, it can be encapsulated by the implementation on powerful devices. On constrained devices, this use case (huge TDs) seems to be irrelevant (to be checked).
Thank you, for the fast response, but the text was merely a reminder to expand later. In any case, I've updated it a little bit the text. The issue is not really about discovery
API, because as you said we have covered it quite well using the Observer patter*.
What I would discuss is how we could provide pagination control of responses in Property or Affordance. As I understood pagination implies the ability to skip a certain amount of pages and retrieve the n. This cannot be covered using a ReadableStream cause you can only read sequentially ( I know you could actually skip the pages, but still you use network bandwidth just for skipping)
* Neither with the observer pattern you can skip and seek to a specific page, but I agree for discovery 90% you would just read the whole thing.
Applications that need access to pages could use the network interface directly.
In most (> 99%) of IoT use cases I expect the client devices to be able to handle full TDs, therefore they could use the current Scripting API (whose implementation will encapsulate paging). In other words, I see this as out of scope for Scripting, at least for now, until we get real use cases, see how those are typically solved, and what makes sense to standardize from those solutions.
The latest specification of Thing Description of a TDD introduces pagination. Even if it used as a convenient way to return a set of TDs, it might as well be used as a return type of one Property or Action affordance. Currently, we could cover this use case using the streaming API. However, you can't really control pages from the streaming API ( you cannot seek a specific page).