namespace qdr.fnd.core.pqueue.Extensions
{
///
/// extension methods."/>
///
public static class PsQueueItemExt
{
///
/// Check if is expired by interval.
/// Ignored and .
///
/// Current item.
/// If true, item is expired by time span validity.
public static bool IsValiditySpanExpired(this IPsQueueItem item)
{
if (item.ValidTo == null)
return false;
return item.ValidTo < DateTime.Now;
}
///
/// Check if is ready to be processed by and interval.
/// Ignores AttemptsLeft and Status.
///
/// Current item.
/// If true, item can be processed by time span validity.
public static bool IsValiditySpanReady(this IPsQueueItem item)
{
if (item.ValidFrom <= DateTime.Now && !item.IsValiditySpanExpired())
return true;
return false;
}
}
}