Skip to content

Instantly share code, notes, and snippets.

Created August 3, 2022 00:24
What would you like to do?
class Client
public TimeSpan Timeout { get; }
public Client(TimeSpan timeout)
this.Timeout = timeout;
public async Task SendAsync(CancellationToken cancellationToken = default)
// Create concatenated new CancellationTokenSource
using var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
await SendCoreAsync(cts.Token);
// snip...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment