Allow cancellation token arg to have another name (#96)

This commit is contained in:
Patrick Stevens
2024-02-14 23:17:20 +00:00
committed by GitHub
parent afc952241d
commit f55a810608
5 changed files with 35 additions and 29 deletions

View File

@@ -1034,7 +1034,7 @@ module ApiWithBasePath =
/// Create a REST client.
let make (client : System.Net.Http.HttpClient) : IApiWithBasePath =
{ new IApiWithBasePath with
member _.GetPathParam (parameter : string, ct : CancellationToken option) =
member _.GetPathParam (parameter : string, cancellationToken : CancellationToken option) =
async {
let! ct = Async.CancellationToken
@@ -1067,7 +1067,7 @@ module ApiWithBasePath =
let! responseString = response.Content.ReadAsStringAsync ct |> Async.AwaitTask
return responseString
}
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = cancellationToken))
}
namespace PureGym

View File

@@ -121,7 +121,7 @@ type internal IApiWithoutBaseAddress =
[<BasePath "foo">]
type IApiWithBasePath =
[<Get "endpoint/{param}">]
abstract GetPathParam : [<Path "param">] parameter : string * ?ct : CancellationToken -> Task<string>
abstract GetPathParam : [<Path "param">] parameter : string * ?cancellationToken : CancellationToken -> Task<string>
[<WoofWare.Myriad.Plugins.HttpClient>]
[<BaseAddress "https://whatnot.com">]