System.Threading.Channels 9.0.0-rc.2.24473.5

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 Downloads
HotChocolate.Execution
Package Description
1,818
HotChocolate.Execution
Package Description
8,996
HotChocolate.Subscriptions.InMemory
Contains an in-memory implementation for a Hot Chocolate GraphQL subscription provider.
246
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
57
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
60
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
64
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
69
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
70
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
77
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
79
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
81
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
83
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
90
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
168
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
1,584
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
5,967
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
10,544
Npgsql
Npgsql is the open source .NET data provider for PostgreSQL.
14,217

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

.NET Framework 4.6.2

.NET 8.0

  • No dependencies.

.NET 9.0

  • No dependencies.

.NET Standard 2.0

.NET Standard 2.1

  • No dependencies.

Version Downloads Last updated
9.0.0-rc.2.24473.5 4 10/12/2024
9.0.0-rc.1.24431.7 6 09/11/2024
9.0.0-preview.7.24405.7 6 08/14/2024
9.0.0-preview.6.24327.7 10 07/17/2024
9.0.0-preview.5.24306.7 7 06/13/2024
9.0.0-preview.4.24266.19 9 05/22/2024
9.0.0-preview.3.24172.9 10 04/19/2024
9.0.0-preview.2.24128.5 10 03/13/2024
9.0.0-preview.1.24080.9 7 02/26/2024
8.0.0 15 11/15/2023
8.0.0-rc.2.23479.6 23 10/17/2023
8.0.0-rc.1.23419.4 17 09/21/2023
8.0.0-preview.7.23375.6 30 08/16/2023
8.0.0-preview.6.23329.7 42 07/11/2023
8.0.0-preview.5.23280.8 32 06/28/2023
8.0.0-preview.4.23259.5 30 06/05/2023
8.0.0-preview.3.23174.8 24 04/15/2023
8.0.0-preview.2.23128.3 31 03/16/2023
8.0.0-preview.1.23110.8 49 02/24/2023
7.0.0 79 01/17/2023
7.0.0-rc.2.22472.3 31 10/16/2022
7.0.0-rc.1.22426.10 25 09/22/2022
7.0.0-preview.7.22375.6 90 08/19/2022
7.0.0-preview.6.22324.4 56 09/17/2022
7.0.0-preview.5.22301.12 30 09/12/2022
7.0.0-preview.4.22229.4 29 10/16/2022
7.0.0-preview.3.22175.4 21 08/29/2022
7.0.0-preview.2.22152.2 40 09/24/2022
7.0.0-preview.1.22076.8 73 09/12/2022
6.0.2-mauipre.1.22102.15 27 09/26/2022
6.0.2-mauipre.1.22054.8 48 09/22/2022
6.0.0 83 09/24/2022
6.0.0-rc.2.21480.5 96 09/12/2022
6.0.0-rc.1.21451.13 90 09/22/2022
6.0.0-preview.7.21377.19 76 09/12/2022
6.0.0-preview.6.21352.12 101 09/12/2022
6.0.0-preview.5.21301.5 88 09/12/2022
6.0.0-preview.4.21253.7 75 09/12/2022
6.0.0-preview.3.21201.4 86 09/12/2022
6.0.0-preview.2.21154.6 51 10/16/2022
6.0.0-preview.1.21102.12 70 09/12/2022
5.0.0 76 09/12/2022
5.0.0-rc.2.20475.5 35 09/12/2022
5.0.0-rc.1.20451.14 32 09/12/2022
5.0.0-preview.8.20407.11 32 09/24/2022
5.0.0-preview.7.20364.11 81 09/12/2022
5.0.0-preview.6.20305.6 95 09/12/2022
5.0.0-preview.5.20278.1 38 09/23/2022
5.0.0-preview.4.20251.6 99 09/12/2022
5.0.0-preview.3.20214.6 82 09/26/2022
5.0.0-preview.2.20160.6 77 09/12/2022
5.0.0-preview.1.20120.5 50 09/12/2022
4.7.1 34 09/12/2022
4.7.0 9,071 09/12/2022
4.7.0-preview3.19551.4 93 09/12/2022
4.7.0-preview2.19523.17 96 09/12/2022
4.7.0-preview1.19504.10 68 09/17/2022
4.6.0 69 09/12/2022
4.6.0-rc1.19456.4 43 10/16/2022
4.6.0-preview9.19421.4 48 09/24/2022
4.6.0-preview9.19416.11 37 09/24/2022
4.6.0-preview8.19405.3 92 09/12/2022
4.6.0-preview7.19362.9 53 09/12/2022
4.6.0-preview6.19303.8 83 09/12/2022
4.6.0-preview6.19264.9 48 09/12/2022
4.6.0-preview5.19224.8 95 09/12/2022
4.6.0-preview4.19212.13 94 09/24/2022
4.6.0-preview3.19128.7 68 09/12/2022
4.6.0-preview.19073.11 83 09/21/2022
4.6.0-preview.18571.3 34 09/12/2022
4.5.0 68 09/12/2022
4.5.0-rc1 46 09/12/2022
4.5.0-preview2-26406-04 60 09/21/2022
4.5.0-preview1-26216-02 51 09/12/2022