using qdr.fnd.core.pqueue.Enums;
using Quadarax.Foundation.Core.Data;
namespace qdr.fnd.core.pqueue
{
public interface IPsQueue : IDisposable
{
#region *** Properties ***
///
/// Flag determines if the queue is running. Means if was called and was not called.
///
bool IsRunning { get; }
#endregion
#region *** Operations ***
///
/// Starts the queue engine to processing queue items. If the queue is already running, the method throws an exception.
///
///
void Start();
void Stop();
///
/// Add new item to queue described by
///
/// Queue item decriptor
/// If succeed returns item identifier (itemId)
string EnQueueItem(IPsQueueItemDescriptor item);
///
/// Get specific queue item (full) by its identifier no matter what set.
/// Item must exists, otherwise throws exception.
///
/// process item identifier.
/// Full queue item (incl. status history).
IPsQueueItem GetQueueItem(string itemId);
///
/// Schedules item to start immediately. Ignores ValidFrom and status exept ,,.
/// Operation resets , , , , , ,
///
/// process item identifier.
/// Sign who emmits request.
void ForceStartQueueItem(string itemId, string emitter);
///
/// Schedules item to stops immediately and set to .
/// If item currently processing, kill process and left (skip decrement) attempt counter.
/// Ignores ValidFrom and status exept ,,.
///
/// process item identifier.
/// Sign who emmits request.
void ForceStopQueueItem(string itemId, string emitter);
///
/// Schedules item to pause immediately and set to and can be resumed by use .
/// If item currently processing, waits to next attempt, then set to paused.
/// Ignores ValidFrom and status exept ,,,.
///
/// process item identifier.
/// Sign who emmits request.
void PauseQueueItem(string itemId, string emmiter);
///
/// Schedules item to start or resume and set to .
///
/// process item identifier.
/// Sign who emmits request.
/// If set to true, reshedule item to run immediately (change , ,
void StartQueueItem(string itemId, string emmiter, bool isImmediate);
///
/// Returns query (queryable) in process queue by custom specification.
///
/// Paging specification for query.
/// Owner identifier. If null then condition is skipped.
/// Owner reference identifier. If null then condition is skipped.
/// If set includes transient states. Default set to False.
/// Collection of requested complex statuses.
/// Queryable result (item is ) collection limited by
IQueryable QueryQueueItems(IPaging paging, string? owner, string? ownerRef, bool includeTransient = false, params PsStatusEnum[] statuses);
#endregion
}
}