GetResultBatchesAsync will run until the infinite
See original GitHub issueVersion
6.1.2
Details
When you call
await foreach (var video in youtube.Search.GetVideosAsync("cicero", token))
{
// Some code here
}
this can run forever until we want to cancel the token
, but what if I want to do some pagination? In that case, when I cancel the method I’ll lose everything else.
So I would like to suggest the support for startPage
and endPage
, with that the method will execute during the delta between these two values and we can do pagination.
I’ve a code working for this feature, if you want I can submit a PR. Added new overloads to avoid breaking changes and too much modification in the API.
Steps to reproduce
- Install the package
- Call using a very popular query
await foreach (var video in youtube.Search.GetVideosAsync("cicero", token))
{
// Some code here
}
- It can take forever
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to replace infinite sleep in async code?
I have code in service fabric that init service and wait forever (it is from template generated from VS). I replaced this GetAwaiter().GetResult...
Read more >In JavaScript, how is awaiting the result of an async ...
In the async version, an await basically just blocks the rest of that function, letting the main loop continue (the part below the...
Read more >What is the best approach to call asynchronous method ...
With this solution the async method runs on thread from thread pool. Because of that, if it hits await it will have it's...
Read more >Understanding Control Flow with Async and Await in C# | ...
Again, this is synchronous; no execution will take place on the current thread until GetResult returns with the data returned by the operation...
Read more >Async return types (C#)
When GetLeisureHoursAsync is called from within an await expression in the ShowTodaysInfo method, the await expression retrieves the integer ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @Tyrrrz