Table of Contents

Class PriorityBufferBlock<T, TPriority>

Namespace
CounterpointCollective.Dataflow
Assembly
Dataflow.Composable.dll
public class PriorityBufferBlock<T, TPriority> : AbstractEncapsulatedPropagatorBlock<(T Message, TPriority Priority), (T Message, TPriority Priority)>, IReceivableSourceBlock<(T Message, TPriority Priority)>, IPropagatorBlock<(T Message, TPriority Priority), (T Message, TPriority Priority)>, ISourceBlock<(T Message, TPriority Priority)>, ITargetBlock<(T Message, TPriority Priority)>, IDataflowBlock

Type Parameters

T
TPriority
Inheritance
AbstractEncapsulatedSourceBlock<(T Message, TPriority Priority)>
AbstractEncapsulatedPropagatorBlock<(T Message, TPriority Priority), (T Message, TPriority Priority)>
PriorityBufferBlock<T, TPriority>
Implements
IPropagatorBlock<(T Message, TPriority Priority), (T Message, TPriority Priority)>
ISourceBlock<(T Message, TPriority Priority)>
ITargetBlock<(T Message, TPriority Priority)>
Inherited Members
Extension Methods

Constructors

PriorityBufferBlock()

public PriorityBufferBlock()

PriorityBufferBlock(IComparer<TPriority>, DataflowBlockOptions, int)

public PriorityBufferBlock(IComparer<TPriority> comparer, DataflowBlockOptions options, int electedBufferSize = 1)

Parameters

comparer IComparer<TPriority>
options DataflowBlockOptions
electedBufferSize int

PriorityBufferBlock(DataflowBlockOptions, int)

public PriorityBufferBlock(DataflowBlockOptions options, int electedBufferSize = 1)

Parameters

options DataflowBlockOptions
electedBufferSize int

The number of items to eagerly buffer for immediate consumption.

A larger buffer can improve throughput when consuming messages, because more items are ready to be delivered without waiting for additional elections. However, a larger buffer also increases the likelihood of re-elections if new messages with higher priority arrive out-of-order. Choose a value that balances consumption throughput against priority accuracy for your scenario.

Properties

Count

public int Count { get; }

Property Value

int

SourceSide

protected override ISourceBlock<(T Message, TPriority Priority)> SourceSide { get; }

Property Value

ISourceBlock<(T Message, TPriority Priority)>

TargetSide

protected override ITargetBlock<(T Message, TPriority Priority)> TargetSide { get; }

Property Value

ITargetBlock<(T Message, TPriority Priority)>

Methods

AwaitElectionsHeldAsync()

public Task AwaitElectionsHeldAsync()

Returns

Task