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

EventQueue<T>

public abstract class EventQueue<T>
Implements a template for a queue of work items each of which is queued as a WaitCallback. It can handle any event types.
public int Count { get; }

Gets the count of items in the queue.

protected EventQueue()

public T Dequeue(bool blockWhenEmpty)

Removes the first element from the queue and returns it (or null).

public void Enqueue(T e)

Enqueues the specified event

public void Stop()

Stop processing of the queue