[FEATURE REQ]Support pause and resume while query entities
See original GitHub issueLibrary or service name. What library or service is this request related to? [e.g. Azure.Storage.Blobs] Azure.Data.Tables
Is your feature request related to a problem? Please describe.
What feature would you like to get added? What problem is it solving?
while query entities using QueryEntityAsync
, the ContinuationToken
is not exposed and cannot be passed in. So there is no way to pause/resume the query. For example, If we have a webpage, which by default shows the first 1000 records(by calling QueryEntityAsync
the first time). And when and only when user clicks a Next Page button, we call QueryEntityAsync
again and return only the next 1000 records from table storage. But for now, the QueryEntityAsync
doesn’t support it. It always iterate all records.
Please correct me if I’m wrong.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (7 by maintainers)
Top GitHub Comments
No the automatic fetching next page is not expected. In our case the
next
call could happen in different context even in different process/VM. We need to serialize and pass the continuationToken from one worker to another.You shouldn’t need to deal with the continuation token at all.
Each iteration through the result of
AsPages
is automatically fetching the next page of results for you using the continuation token behind the scenes. It does not fetch a page until the enumeration is iterated over. The page size is controlled by themaxItemsPerPage
parameter sent to theQuery
method.So, if you only wanted to fetch the first 10 items of a query that would return 1000’s of items, you could specify a
maxItemsPerPage
value of 10 and exit the foreach loop after just one iteration.Note that no matter what value is used for
maxItemsPerPage
, if you iterate through the loop until completion, you’ll get the full result set, no matter how many there are.