generated from WebAssembly/wasi-proposal-template
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
In the current spec the bucket.list-keys operation and associated key-response struct gives a cursor: option<string> as a mechanism for implementing pagination. This introduces several problems for implementors:
- How long does the implementation have to keep a continuation around for future pagination? This could potentially be very costly in terms of memory and may create consistency issues.
- What happens if the implementation is given a cursor that it doesn't recognize?
- What sort of information does the implementation put into the cursor string? How are we sure that implementations won't do something improper with that information, e.g. parse it for hints or otherwise rely on its contents, creating a portability problem?
All of these problems are solved by changing from an option<string> to, instead, defining a new resource cursor { next: func() -> result<key-response, cursor-error> }, changing key-response to contain an option<cursor>, and eliminating the cursor: option<string> argument from list-keys:
- The implementation keeps track of the information required to return more values around until the resource is dropped, and can return an error in the case of insufficient memory, consistency issues, etc
- Resources are unforgable
- Resources are opaque
Metadata
Metadata
Assignees
Labels
No labels