namespace qdr.fnd.core.pqueue
{
    public interface IPsQueue : IDisposable
    {
        #region *** Properties ***
        /// <summary>
        /// Flag determines if the queue is running. Means if <see cref="Start"/> was called and <see cref="Stop"/> was not called.
        /// </summary>
        bool IsRunning { get; }
        #endregion

        #region *** Operations ***
        /// <summary>
        /// Starts the queue engine to processing queue items. If the queue is already running, the method throws an exception.
        /// <exception cref="CodeExeption"></exception>
        /// </summary>
        void Start();
        void Stop();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        string EnQueue(IPsQueueItemDescriptor item);

        bool DeQueue(string itemId, bool force);

        #endregion
    }
}
