System.Threading.Channels 9.0.3
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
Related Packages
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 |
|---|---|
|
protobuf-net.Grpc
Package Description
|
234 |
|
MassTransit
MassTransit provides a developer-focused, modern platform for creating distributed applications without complexity.
|
230 |
|
Microsoft.CodeAnalysis.Workspaces.Common
A shared package used by the .NET Compiler Platform ("Roslyn") including support for analyzing projects and solutions.
Do not install this package manually, it will be added as a prerequisite by other packages that require it.
More details at https://aka.ms/roslyn-packages
This package was built from the source at https://github.com/dotnet/roslyn/commit/6a5a63bbc9f4449d9bd1e95a8f9624939c3ccdc3.
|
230 |
|
MassTransit
MassTransit provides a developer-focused, modern platform for creating distributed applications without complexity.
|
13 |
|
Akka
Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
|
13 |
|
MassTransit
MassTransit provides a developer-focused, modern platform for creating distributed applications without complexity.
|
12 |
|
StrawberryShake.Core
Abstractions and foundational APIs for StrawberryShake GraphQL clients.
|
11 |
|
MassTransit
MassTransit provides a developer-focused, modern platform for creating distributed applications without complexity.
|
11 |
|
MassTransit
MassTransit provides a developer-focused, modern platform for creating distributed applications without complexity.
|
10 |
|
Akka
Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
|
9 |
|
StrawberryShake.Core
Abstractions and foundational APIs for StrawberryShake GraphQL clients.
|
9 |
|
Azure.Messaging.ServiceBus
Azure Service Bus is a fully managed enterprise integration message broker. Service Bus can decouple applications and services. Service Bus offers a reliable and secure platform for asynchronous transfer of data and state. This client library allows for both sending and receiving messages using Azure Service Bus. For more information about Service Bus, see https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview
|
9 |
|
Microsoft.CodeAnalysis.Features
.NET Compiler Platform ("Roslyn") support for creating editing experiences.
More details at https://aka.ms/roslyn-packages
This package was built from the source at https://github.com/dotnet/roslyn/commit/5e3a11e2e7f952da93f9d35bd63a2fa181c0608b.
|
9 |
|
MassTransit
MassTransit provides a developer-focused, modern platform for creating distributed applications without complexity.
|
9 |
.NET Framework 4.6.2
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.3)
- System.Threading.Tasks.Extensions (>= 4.5.4)
.NET 8.0
- No dependencies.
.NET 9.0
- No dependencies.
.NET Standard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.3)
- System.Threading.Tasks.Extensions (>= 4.5.4)
.NET Standard 2.1
- No dependencies.