namespace Connected.Collections.Concurrent; public enum DispatcherProcessBehavior { Parallel = 1, Queued = 2 } public interface IDispatcher : IDisposable where TJob : IDispatcherJob { bool Dequeue(out TArgs? item); bool Enqueue(TArgs item); bool Enqueue(string queue, TArgs item); DispatcherProcessBehavior Behavior { get; } CancellationToken CancellationToken { get; } void Cancel(); }