FusionAuth / fusionauth-issues

FusionAuth issue submission project
https://fusionauth.io
90 stars 12 forks source link

Support cancellation tokens in .NET client #2652

Open jpineault opened 4 months ago

jpineault commented 4 months ago

Support cancellation tokens in .NET client

Problem

The FusionAuth client provides asynchrounous code, yet does not accept cancellation tokens (a best practice for such code).

Solution

Accept a cancellation token parameter in asynchronous methods offered by the FusionAuth client.

Example signature: Task<ClientResponse<UserResponse>> UpdateUserAsync(Guid? userId, UserRequest request, CancellationToken cancellationToken = default);

Example request: await this._fusionAuthClient.UpdateUserAsync(id, new UserRequest { user = user }, cancellationToken);