# System.Threading.Channels ``` diff +namespace System.Threading.Channels { + public enum BoundedChannelFullMode { + DropNewest = 1, + DropOldest = 2, + DropWrite = 3, + Wait = 0, + } + public sealed class BoundedChannelOptions : ChannelOptions { + public BoundedChannelOptions(int capacity); + public int Capacity { get; set; } + public BoundedChannelFullMode FullMode { get; set; } + } + public static class Channel { + public static Channel CreateBounded(int capacity); + public static Channel CreateBounded(BoundedChannelOptions options); + public static Channel CreateUnbounded(); + public static Channel CreateUnbounded(UnboundedChannelOptions options); + } + public abstract class Channel : Channel { + protected Channel(); + } + public abstract class Channel { + protected Channel(); + public ChannelReader Reader { get; protected set; } + public ChannelWriter Writer { get; protected set; } + public static implicit operator ChannelReader (Channel channel); + public static implicit operator ChannelWriter (Channel channel); + } + public class ChannelClosedException : InvalidOperationException { + public ChannelClosedException(); + public ChannelClosedException(Exception innerException); + protected ChannelClosedException(SerializationInfo info, StreamingContext context); + public ChannelClosedException(string message); + public ChannelClosedException(string message, Exception innerException); + } + public abstract class ChannelOptions { + protected ChannelOptions(); + public bool AllowSynchronousContinuations { get; set; } + public bool SingleReader { get; set; } + public bool SingleWriter { get; set; } + } + public abstract class ChannelReader { + protected ChannelReader(); + public virtual bool CanCount { get; } + public virtual Task Completion { get; } + public virtual int Count { get; } + public virtual IAsyncEnumerable ReadAllAsync(CancellationToken cancellationToken = default(CancellationToken)); + public virtual ValueTask ReadAsync(CancellationToken cancellationToken = default(CancellationToken)); + public abstract bool TryRead(out T item); + public abstract ValueTask WaitToReadAsync(CancellationToken cancellationToken = default(CancellationToken)); + } + public abstract class ChannelWriter { + protected ChannelWriter(); + public void Complete(Exception error = null); + public virtual bool TryComplete(Exception error = null); + public abstract bool TryWrite(T item); + public abstract ValueTask WaitToWriteAsync(CancellationToken cancellationToken = default(CancellationToken)); + public virtual ValueTask WriteAsync(T item, CancellationToken cancellationToken = default(CancellationToken)); + } + public sealed class UnboundedChannelOptions : ChannelOptions { + public UnboundedChannelOptions(); + } +} ```