mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-10-06 20:48:40 +00:00
Allow cancellation token arg to have another name (#96)
This commit is contained in:
@@ -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
|
||||
|
||||
|
@@ -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">]
|
||||
|
Reference in New Issue
Block a user