using System.Threading.Tasks;
using System.Threading.Channels;
public static class Program
public static async Task Main()
Channel<int> channel = Channel.CreateUnbounded<int>();
ValueTask<int> task1 = channel.Reader.ReadAsync(new CancellationToken(true));
catch (Exception ex) { Console.WriteLine(ex.GetType().Name); }
ValueTask<int> task2 = channel.Reader.ReadAsync(new CancellationTokenSource(100).Token);
catch (Exception ex) { Console.WriteLine(ex.GetType().Name); }