MixedConsumerProducerOptions Class

Options that configure MixedConsumerProducer.Process, including a bound on the number of pending items.

public sealed class MixedConsumerProducerOptions : ParallelOptions

Remarks

ParallelOptions.MaxDegreeOfParallelism limits the number of items being processed at the same time, while MixedConsumerProducerOptions.MaxPendingItems limits the number of items waiting to be processed. They are distinct limits.

Inheritance
ParallelOptions MixedConsumerProducerOptions

Constructors

NameDescription
MixedConsumerProducerOptions()

MixedConsumerProducerOptions()

MixedConsumerProducerOptions.cs
public MixedConsumerProducerOptions()

No documentation is available.

Properties

NameDescription
MaxPendingItemsGets or sets the maximum number of items waiting to be processed, not counting the items being processed. The default value, -1, does not limit them.

Gets or sets the maximum number of items waiting to be processed, not counting the items being processed. The default value, -1, does not limit them.

public int MaxPendingItems { get; set; }

Property value

int

Exceptions

ArgumentOutOfRangeException
The value is 0 or less than -1.

Remarks

When the limit is reached, the enumeration of the initial items waits until an item is dequeued, and MixedConsumerProducerContext<T>.EnqueueAsync waits as well. When every consumer would wait, the item is processed by the caller of MixedConsumerProducerContext<T>.EnqueueAsync before it returns, so the processing cannot deadlock and no item is dropped.

MixedConsumerProducerContext<T>.Enqueue cannot wait: it throws an InvalidOperationException when the limit is reached. MixedConsumerProducerContext<T>.TryEnqueue returns false.