Class PipeQueue<T>
- Namespace
- MarymoorStudios.Core.Rpc
- Assembly
- MarymoorStudios.Core.Rpc.dll
public sealed class PipeQueue<T>
Type Parameters
T
- Inheritance
-
PipeQueue<T>
- Inherited Members
Methods
Create(int, int)
Constructs a new Pipe<T>
public static Pipe<T> Create(int capacity = 2147483647, int threshold = 1)
Parameters
capacity
intThe maximum number of items before backpressure is applied.
threshold
intThe number of items of empty space available before backpressure is released.
Returns
- Pipe<T>
Remarks
REQUIRES: capacity > 2
REQUIRES: 1 <= threshold < capacity -1
Capacity is equal to the size of the memory allocation (in number of items).
Threshold is used to decrease ping-ponging by delaying waking the producer until there are more items in the window. There is a tradeoff between added latency and buffering costs on the writer side versus signalling costs. The default value is 1 causing the producer to be signalled whenever there is at least one slot available.