<PackageReference Include="NUnit" Version="3.10.1" />

IProducerConsumerCollection<T>

Defines methods to manipulate thread-safe collections intended for producer/consumer usage.
void CopyTo(T[] array, int index)

Copies the elements of the IProducerConsumerCollection<T> to an Array, starting at a specified index.

T[] ToArray()

Copies the elements contained in the IProducerConsumerCollection<T> to a new array.

bool TryAdd(T item)

Attempts to add an object to the IProducerConsumerCollection<T>.

bool TryTake(out T item)

Attempts to remove and return an object from the IProducerConsumerCollection<T>.