Provides a set of highly scalable, low/no-allocation synchronization data structures for passing data between producers and consumers asynchronously.
System.Threading.Channels contains the abstractions and base implementation for async friendly queues as a replacement for synchronous thread-safe BlockingCollection and ConcurrentQueue.
It's also a partial replacement for the System.Threading.Tasks.Dataflow async friendly queues (which is implicitly implemented inside BufferBlock and other blocks).
The API Proposal is probably the only official documentation at the moment.
Exploring System.Threading.Channels offers a good overview of channels
Decoupling
Publishers and subscribers can only access a channel through a ChannelWriter and ChannelReader respectively. This decouples publishers, subscribers and the channel implementation itself.
Backpressure
A Bounded Channel allows only a specific number of items. Its behaviour when full depends on the BoundedChannelFullMode option. By default, publishers will have to wait asynchronously if a channel becomes full.
Other values of the BoundedChannelFullMode enum allow different behaviours. For example, DropOldest
can be used to create a circular buffer. DropWrite
can be used to throttle publishers by rejecting overflowing messages.