namespace XF.Domain.Queues
{
    public interface IQueue
    {
        void Enqueue<TItem>(string queueName, TItem item);
        void Enqueue<TItem>(string queueName, IList<TItem> items);
        Task EnqueueAsync<TItem>(string queueName, TItem item, CancellationToken cancellationToken = default);
        Task EnqueueAsync<TItem>(string queueName, IList<TItem> items, CancellationToken cancellationToken = default);
        TItem? Dequeue<TItem>(string queueName);
        Task<TItem?> DequeueAsync<TItem>(string queueName, CancellationToken cancellationToken = default);
        long Count(string queueName);
        Task<long> CountAsync(string queueName, CancellationToken cancellationToken = default);
        void Remove<TItem>(string queueName, TItem item, bool fromHead = false, long count = 0);
        Task RemoveAsync<TItem>(string queueName, TItem item, bool fromHead = false, long count = 0, CancellationToken cancellationToken = default);
        void EnqueueConcurrent<TItem>(string queueName, TItem item);
        Task EnqueueConcurrentAsync<TItem>(string queueName, TItem item, CancellationToken cancellationToken = default);
    }
}
