Skip to content

Add CancellationToken support to all async methods #26

Description

@tw4

Summary

All public async methods in Nexar lack CancellationToken support. This means long-running HTTP requests cannot be cancelled by the caller.

Affected Methods

  • GetAsync<T>()
  • PostAsync<T>()
  • PutAsync<T>()
  • DeleteAsync<T>()
  • PatchAsync<T>()
  • HeadAsync<T>()
  • All corresponding methods in NexarRequestBuilder

Expected Behavior

Each async method should accept an optional CancellationToken cancellationToken = default parameter and pass it down to the underlying HttpClient call.

Example

var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5));
var response = await Nexar.GetAsync<MyModel>(url, cancellationToken: cts.Token);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions