Show / Hide Table of Contents

Class PersistentChannel<TInput, TOutput>

Represents persistent unbounded channel.

Inheritance
object
Channel<TInput, TOutput>
PersistentChannel<TInput, TOutput>
Implements
IDisposable
Inherited Members
Channel<TInput, TOutput>.Reader
Channel<TInput, TOutput>.Writer
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DotNext.Threading.Channels
Assembly: DotNext.Threading.dll
Syntax
public abstract class PersistentChannel<TInput, TOutput> : Channel<TInput, TOutput>, IDisposable where TInput : notnull where TOutput : notnull
Type Parameters
Name Description
TInput

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

TOutput

Specifies the type of data that may be read from the channel.

Constructors

| Edit this page View Source

PersistentChannel(PersistentChannelOptions)

Initializes a new persistent channel with the specified options.

Declaration
protected PersistentChannel(PersistentChannelOptions options)
Parameters
Type Name Description
PersistentChannelOptions options

The options of the channel.

Properties

| Edit this page View Source

RemainingCount

Gets the number of unread messages.

Declaration
public long RemainingCount { get; }
Property Value
Type Description
long

The number of unread messages.

| Edit this page View Source

Throughput

Gets ratio between number of consumed and produced messages.

Declaration
public double Throughput { get; }
Property Value
Type Description
double

Methods

| Edit this page View Source

DeserializeAsync(Stream, CancellationToken)

Deserializes message from stream asynchronously.

Declaration
protected abstract ValueTask<TOutput> DeserializeAsync(Stream input, CancellationToken token)
Parameters
Type Name Description
Stream input

The stream containing serialized message.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<TOutput>

Deserialized message.

| Edit this page View Source

Dispose()

Releases all resources associated with this channel.

Declaration
public void Dispose()
| Edit this page View Source

Dispose(bool)

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

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing

true to dispose all resources; false to release unmanaged resources only.

| Edit this page View Source

~PersistentChannel()

Releases file handles associated with this channel.

Declaration
protected ~PersistentChannel()
| Edit this page View Source

SerializeAsync(TInput, Stream, CancellationToken)

Serializes message to stream asynchronously.

Declaration
protected abstract ValueTask SerializeAsync(TInput input, Stream output, CancellationToken token)
Parameters
Type Name Description
TInput input

The message to serialize.

Stream output

The stream used to serialize object.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask

The task representing asynchronous state of operation.

Implements

IDisposable

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan, CancellationToken)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾