You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
961 B
45 lines
961 B
using System.ComponentModel.DataAnnotations;
|
|
using Connected.Annotations;
|
|
using Connected.ServiceModel;
|
|
|
|
namespace Connected.Collections.Queues;
|
|
|
|
public class QueueArgs : Dto
|
|
{
|
|
public QueueArgs()
|
|
{
|
|
Options = new();
|
|
}
|
|
|
|
public EnqueueOptions Options { get; set; }
|
|
}
|
|
|
|
public class PrimaryKeyQueueArgs<TPrimaryKey> : QueueArgs
|
|
where TPrimaryKey : notnull
|
|
{
|
|
public TPrimaryKey Id { get; set; } = default!;
|
|
}
|
|
|
|
public sealed class EnqueueOptions
|
|
{
|
|
/// <summary>
|
|
/// The date and time the queue message expires.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Queue messages that are not processed until they expire
|
|
/// gets automatically deleted by the system.
|
|
/// </remarks>
|
|
public DateTime Expire { get; set; } = DateTime.UtcNow.AddHours(48);
|
|
}
|
|
|
|
public sealed class DequeueArgs : Dto
|
|
{
|
|
[NonDefault]
|
|
public List<string> Queues { get; set; } = default!;
|
|
|
|
[Range(1, int.MaxValue)]
|
|
public int MaxCount { get; set; }
|
|
|
|
public TimeSpan NextVisible { get; set; }
|
|
}
|