DotNext.Threading by .NET Foundation and Contributors

<PackageReference Include="DotNext.Threading" Version="4.9.0" />

 PersistentChannel<TInput, TOutput>

public abstract class PersistentChannel<TInput, TOutput> : Channel<TInput, TOutput>, IChannelWriter<TInput>, IChannel, IChannelReader<TOutput>, IDisposable
Represents persistent unbounded channel.
public long RemainingCount { get; }

Gets the number of unread messages.

public double Throughput { get; }

Gets ratio between number of consumed and produced messages.

Initializes a new persistent channel with the specified options.

protected abstract ValueTask<TOutput> DeserializeAsync(Stream input, CancellationToken token)

Deserializes message from stream asynchronously.

protected virtual void Dispose(bool disposing)

Releases managed and, optionally, unmanaged resources associated with this channel.

public void Dispose()

Releases all resources associated with this channel.

protected abstract ValueTask SerializeAsync(TInput input, Stream output, CancellationToken token)

Serializes message to stream asynchronously.