Skip to content

Commit

Permalink
unify cancellationtoken usage
Browse files Browse the repository at this point in the history
  • Loading branch information
KircMax committed Dec 2, 2023
1 parent f6fba5c commit ad3a3c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
14 changes: 0 additions & 14 deletions src/Webserver.API/Services/ApiStandardServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,20 +280,6 @@ public HttpClient GetHttpClient(HttpClientConnectionConfiguration connectionConf
/// <param name="username">username to login with</param>
/// <param name="password">password to login with</param>
/// <returns>A usable and authenticated <see cref="ApiHttpClientRequestHandler"/></returns>
public async Task<IApiRequestHandler> GetApiHttpClientRequestHandlerAsync(string baseAddress, string username, string password)
{
var httpClient = await GetHttpClientAsync(baseAddress, username, password);
return new ApiHttpClientRequestHandler(httpClient, _apiRequestFactory, _apiResponseChecker);
}

/// <summary>
/// Get an <see cref="ApiHttpClientRequestHandler"/> using standard values for <see cref="HttpClientConnectionConfiguration"/>
/// </summary>
/// <param name="baseAddress">ip address or dns name of your plc</param>
/// <param name="username">username to login with</param>
/// <param name="password">password to login with</param>
/// <param name="cancellationToken">Cancellation token to cancel pending requests.</param>
/// <returns>A usable and authenticated <see cref="ApiHttpClientRequestHandler"/></returns>
public async Task<IApiRequestHandler> GetApiHttpClientRequestHandlerAsync(string baseAddress, string username, string password, CancellationToken cancellationToken = default(CancellationToken))
{
var httpClient = await GetHttpClientAsync(baseAddress, username, password, cancellationToken);
Expand Down
13 changes: 2 additions & 11 deletions src/Webserver.API/Services/IApiServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public interface IApiServiceFactory
/// <param name="connectionConfiguration">Connection configuration to use</param>
/// <param name="cancellationToken">Cancellation token to cancel pending requests.</param>
/// <returns>A usable and authenticated <see cref="ApiHttpClientRequestHandler"/></returns>
Task<IApiRequestHandler> GetApiHttpClientRequestHandlerAsync(HttpClientConnectionConfiguration connectionConfiguration, CancellationToken cancellationToken);
Task<IApiRequestHandler> GetApiHttpClientRequestHandlerAsync(HttpClientConnectionConfiguration connectionConfiguration, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Get an httpclient using the given <see cref="HttpClientConnectionConfiguration"/>
/// </summary>
Expand All @@ -60,16 +60,7 @@ public interface IApiServiceFactory
/// <param name="username">username to login with</param>
/// <param name="password">password to login with</param>
/// <returns>A usable and authenticated <see cref="ApiHttpClientRequestHandler"/></returns>
Task<IApiRequestHandler> GetApiHttpClientRequestHandlerAsync(string baseAddress, string username, string password);
/// <summary>
/// Get an <see cref="ApiHttpClientRequestHandler"/>
/// </summary>
/// <param name="baseAddress">ip address or dns name of your plc</param>
/// <param name="username">username to login with</param>
/// <param name="password">password to login with</param>
/// <param name="cancellationToken">Cancellation token to cancel pending requests.</param>
/// <returns>A usable and authenticated <see cref="ApiHttpClientRequestHandler"/></returns>
Task<IApiRequestHandler> GetApiHttpClientRequestHandlerAsync(string baseAddress, string username, string password, CancellationToken cancellationToken);
Task<IApiRequestHandler> GetApiHttpClientRequestHandlerAsync(string baseAddress, string username, string password, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Get A resourceHandler with the given requestHandler and the set resourcebuilder
/// </summary>
Expand Down

0 comments on commit ad3a3c7

Please sign in to comment.