using System.Collections.Immutable; using Connected.Annotations; namespace Connected.Collections.Queues; /// /// Represents a distributed service for processing queue messages. /// /// /// Queue mechanism is mostly used as an internal logic of processes /// and resources to offload work from the main thread to achieve better /// responsiveness of the system. Aggregations and calculations are good /// examples of queue usage. You should use queue whenever you must /// perform any kind of work that is not necessary to perform it in a single /// transaction scope. /// [Service] [ServiceUrl(CollectionRoutes.Queue)] public interface IQueueService { /// /// Enqueues the queue message. /// /// The type of the arguments used in queue message /// The arguments containing information about a queue message. Task Enqueue(TArgs args) where TClient : IQueueClient where TArgs : QueueArgs; /// /// Dequeues the queue messages based on the provided arguments. /// /// The arguments containing information about dequeue criteria. /// A list of valid queue messages that can be immediatelly processed.S Task> Dequeue(DequeueArgs args); }