System.Threading.Channels 10.0.0-preview.2.25163.2

About

The System.Threading.Channels library provides types for passing data asynchronously between producers and consumers.

Key Features

  • Abstractions representing channels for one or more producers to publish data to one or more consumers
  • APIs focused on asynchronous production and consumption of data
  • Factory methods for producing multiple kinds of channels

How to Use

using System;
using System.Threading.Channels;
using System.Threading.Tasks;

Channel<int> channel = Channel.CreateUnbounded<int>();

Task producer = Task.Run(async () =>
{
    int i = 0;
    while (true)
    {
        channel.Writer.TryWrite(i++);
        await Task.Delay(TimeSpan.FromSeconds(1));
    }
});

Task consumer = Task.Run(async () =>
{
    await foreach (int value in channel.Reader.ReadAllAsync())
    {
        Console.WriteLine(value);
    }
});

await Task.WhenAll(producer, consumer);

Main Types

The main types provided by this library are:

  • System.Threading.Channel<T>
  • System.Threading.Channel

Additional Documentation

https://www.nuget.org/packages/System.Threading.Tasks.Dataflow/

Feedback & Contributing

System.Threading.Channels is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on System.Threading.Channels.

Packages
Microsoft.AspNetCore.App
Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv
Libuv transport for the ASP.NET Core Kestrel cross-platform web server. This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/c5f85986e62dabfc0b7f2f2a45dc7c22e8ac815f
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/8e941eb42f819adb116b881195158b3887a70a1c
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/d62be99ba6e73feb46d7b64a6b4ce8610dc9040a
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/561deb05ae2d6680206e3d4a6bc75de699585980
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/aee5e4080331553ea9dfb7fb388b6d72f715bf6a
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/440dadc05b2bed38e6a726c2492db90e77d43c62
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/b1beadfe0ad3d02eb5207681a5328793c4b3822c
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/a5920c6656c9b8cef9e1f769c28062f0ade62f60
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/8ad057426fa6a27cd648b05684afddab9d97d3d9
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/ffaea14b06ea8b247fa4894b7d21ecf6da2cafbc
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/36f34b3a19eb7219142ab2035921d08e84c572c3
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/cb14812a5c6098bd1091f5b7fd471ce2be45e8dd
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/da6e34b3e17bac8fd1f78c7e76d7ed6192514651
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/e81033e094d4663ffd227bb4aed30b76b0631e6d
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/471e4710a818849eaf22c5977281d10fd6758616
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/d634f2bd1ad6e319f26ff0f1d7ada5539158a19f
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/3c37ef8f5358abb303c05d299f029fca7d867d56

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

.NET 8.0

  • No dependencies.

.NET 9.0

  • No dependencies.

.NET 10.0

  • No dependencies.

.NET Standard 2.0

.NET Standard 2.1

  • No dependencies.

Version Last updated
10.0.0-preview.3.25171.5 04/10/2025
10.0.0-preview.2.25163.2 03/22/2025
10.0.0-preview.1.25080.5 03/22/2025
9.0.4 04/08/2025
9.0.3 03/16/2025
9.0.2 03/16/2025
9.0.1 01/14/2025
9.0.0 11/12/2024
9.0.0-rc.2.24473.5 10/08/2024
9.0.0-rc.1.24431.7 03/17/2025
9.0.0-preview.7.24405.7 03/17/2025
9.0.0-preview.6.24327.7 03/24/2025
9.0.0-preview.5.24306.7 06/11/2024
9.0.0-preview.4.24266.19 05/21/2024
9.0.0-preview.3.24172.9 03/16/2025
9.0.0-preview.2.24128.5 03/21/2025
9.0.0-preview.1.24080.9 03/17/2025
8.0.0 03/29/2025
8.0.0-rc.2.23479.6 03/22/2025
8.0.0-rc.1.23419.4 09/12/2023
8.0.0-preview.7.23375.6 03/31/2025
8.0.0-preview.6.23329.7 03/17/2025
8.0.0-preview.5.23280.8 03/22/2025
8.0.0-preview.4.23259.5 05/16/2023
8.0.0-preview.3.23174.8 03/20/2025
8.0.0-preview.2.23128.3 03/17/2025
8.0.0-preview.1.23110.8 03/22/2025
7.0.0 03/12/2025
7.0.0-rc.2.22472.3 03/16/2025
7.0.0-rc.1.22426.10 03/16/2025
7.0.0-preview.7.22375.6 03/21/2025
7.0.0-preview.6.22324.4 03/22/2025
7.0.0-preview.5.22301.12 06/14/2022
7.0.0-preview.4.22229.4 03/21/2025
7.0.0-preview.3.22175.4 03/17/2025
7.0.0-preview.2.22152.2 03/20/2025
7.0.0-preview.1.22076.8 03/31/2025
6.0.0 03/27/2025
6.0.0-rc.2.21480.5 10/12/2021
6.0.0-rc.1.21451.13 03/20/2025
6.0.0-preview.7.21377.19 03/26/2025
6.0.0-preview.6.21352.12 07/14/2021
6.0.0-preview.5.21301.5 04/16/2025
6.0.0-preview.4.21253.7 03/20/2025
6.0.0-preview.3.21201.4 04/08/2021
6.0.0-preview.2.21154.6 03/22/2025
6.0.0-preview.1.21102.12 03/31/2025
5.0.0 03/22/2025
5.0.0-rc.2.20475.5 03/31/2025
5.0.0-rc.1.20451.14 03/22/2025
5.0.0-preview.8.20407.11 03/16/2025
5.0.0-preview.7.20364.11 03/17/2025
5.0.0-preview.6.20305.6 03/17/2025
5.0.0-preview.5.20278.1 03/17/2025
5.0.0-preview.4.20251.6 03/14/2025
5.0.0-preview.3.20214.6 03/20/2025
5.0.0-preview.2.20160.6 03/22/2025
5.0.0-preview.1.20120.5 03/16/2020
4.7.1 03/22/2025
4.7.0 12/03/2019
4.7.0-preview3.19551.4 03/22/2025
4.7.0-preview2.19523.17 03/20/2025
4.7.0-preview1.19504.10 10/15/2019
4.6.0 09/23/2019
4.6.0-rc1.19456.4 03/22/2025
4.6.0-preview9.19421.4 03/20/2025
4.6.0-preview9.19416.11 09/04/2019
4.6.0-preview8.19405.3 03/24/2025
4.6.0-preview7.19362.9 03/22/2025
4.6.0-preview6.19303.8 03/21/2025
4.6.0-preview6.19264.9 03/21/2025
4.6.0-preview5.19224.8 05/06/2019
4.6.0-preview4.19212.13 03/22/2025
4.6.0-preview3.19128.7 03/22/2025
4.6.0-preview.19073.11 03/16/2025
4.6.0-preview.18571.3 12/03/2018
4.5.0 05/29/2018
4.5.0-rc1 03/17/2025
4.5.0-preview2-26406-04 03/12/2025
4.5.0-preview1-26216-02 03/20/2025