Skip to content

Instantly share code, notes, and snippets.

@neuecc
Created August 2, 2022 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neuecc/53c209e581df12fd85a295774a2a8569 to your computer and use it in GitHub Desktop.
Save neuecc/53c209e581df12fd85a295774a2a8569 to your computer and use it in GitHub Desktop.
// Dispose will stop internal timer to prevent timer leak
using var cts = new CancellationTokenSource();
cts.CancelAfter(TimeSpan.FromMinutes(1));
await client.SendAsync(cts.Token);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment