MixedConsumerProducerOptions Class
Options that configure MixedConsumerProducer.Process, including a bound on the number of pending items.
public sealed class MixedConsumerProducerOptions : ParallelOptionsRemarks
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
ParallelOptionsMixedConsumerProducerOptions
Constructors
| Name | Description |
|---|---|
| MixedConsumerProducerOptions() |
MixedConsumerProducerOptions()
MixedConsumerProducerOptions.cspublic MixedConsumerProducerOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| MaxPendingItems | 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. |
MaxPendingItems
MixedConsumerProducerOptions.csGets 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
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.