Struct NativeMultiQueue<T>
A NativeMultiQueue is a set of several FIFO queues split into buckets.
Each bucket has its own first and last item and each bucket can have
items pushed and popped individually.
Syntax
public struct NativeMultiQueue<T> : IDisposable where T : struct
Type Parameters
Constructors
NativeMultiQueue(Int32)
New NativeMultiQueue has a single bucket and the specified number
of items for that bucket. Accessing buckets out of range will grow
the number of buckets and pushing more items than the initial capacity
will increase the number of items for each bucket.
Declaration
public NativeMultiQueue(int initialMessageCapacity)
Parameters
Type |
Name |
Description |
Int32 |
initialMessageCapacity |
|
Properties
IsCreated
Declaration
public bool IsCreated { get; }
Property Value
Methods
Clear(Int32)
Remove all items from a specific bucket. If the bucket does not exist
the call will not do anything.
Declaration
public void Clear(int bucket)
Parameters
Type |
Name |
Description |
Int32 |
bucket |
|
Dequeue(Int32, out T)
Dequeue an item from a specific bucket. If the bucket does not exist or if the
bucket is empty the call will fail and return false.
Declaration
public bool Dequeue(int bucket, out T value)
Parameters
Type |
Name |
Description |
Int32 |
bucket |
|
T |
value |
|
Returns
Dispose()
Declaration
Enqueue(Int32, T)
Enqueue a new item to a specific bucket. If the bucket does not yet exist
the number of buckets will be increased and if the queue is full the number
of items for each bucket will be increased.
Declaration
public void Enqueue(int bucket, T value)
Parameters
Type |
Name |
Description |
Int32 |
bucket |
|
T |
value |
|
Peek(Int32, out T)
Peek the next item in a specific bucket. If the bucket does not exist or if the
bucket is empty the call will fail and return false.
Declaration
public bool Peek(int bucket, out T value)
Parameters
Type |
Name |
Description |
Int32 |
bucket |
|
T |
value |
|
Returns