mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2025-01-09 05:17:47 +00:00
Cancellation token in SpotifyClient::PaginateAll for passing to Paginator (#907)
* adding cancellation token in SpotifyClient::PaginateAll and passing to IPaginator * adding docstring for cancellation token
This commit is contained in:
parent
d8ca3b5d6d
commit
fdde87e476
@ -105,9 +105,10 @@ namespace SpotifyAPI.Web
|
||||
/// </summary>
|
||||
/// <param name="firstPage">The first page, will be included in the output list!</param>
|
||||
/// <param name="paginator">Optional. If not supplied, DefaultPaginator will be used</param>
|
||||
/// <param name="cancellationToken">The cancellation-token to allow to cancel the request.</param>
|
||||
/// <typeparam name="T">The Paging-Type</typeparam>
|
||||
/// <returns>A list containing all fetched pages</returns>
|
||||
Task<IList<T>> PaginateAll<T>(IPaginatable<T> firstPage, IPaginator? paginator = default!);
|
||||
Task<IList<T>> PaginateAll<T>(IPaginatable<T> firstPage, IPaginator? paginator = default!, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Fetches all pages and returns them grouped in a list.
|
||||
|
@ -91,11 +91,12 @@ namespace SpotifyAPI.Web
|
||||
/// </summary>
|
||||
/// <param name="firstPage">The first page, will be included in the output list!</param>
|
||||
/// <param name="paginator">Optional. If not supplied, DefaultPaginator will be used</param>
|
||||
/// <param name="cancellationToken">The cancellation-token to allow to cancel the request.</param>
|
||||
/// <typeparam name="T">The Paging-Type</typeparam>
|
||||
/// <returns>A list containing all fetched pages</returns>
|
||||
public Task<IList<T>> PaginateAll<T>(IPaginatable<T> firstPage, IPaginator? paginator = null)
|
||||
public Task<IList<T>> PaginateAll<T>(IPaginatable<T> firstPage, IPaginator? paginator = null, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return (paginator ?? DefaultPaginator).PaginateAll(firstPage, _apiConnector);
|
||||
return (paginator ?? DefaultPaginator).PaginateAll(firstPage, _apiConnector, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user