ChannelWriter<T> Class

Definition

Provides a base class for writing to a channel.

public abstract class ChannelWriter<T>

Type Parameters

T

Specifies the type of data that may be written to the channel.

Inheritance
ChannelWriter<T>

Constructors

ChannelWriter<T>()

Initializes an instance of the ChannelWriter<T> class.

Methods

Complete(Exception)

Mark the channel as being complete, meaning no more items will be written to it.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)
TryComplete(Exception)

Attempts to mark the channel as being completed, meaning no more data will be written to it.

TryWrite(T)

Attempts to write the specified item to the channel.

WaitToWriteAsync(CancellationToken)

Returns a ValueTask<TResult> that will complete when space is available to write an item.

WriteAsync(T, CancellationToken)

Asynchronously writes an item to the channel.

Applies to

Produkt Versjoner
.NET Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)