src/Orleans.Streaming/Common/PooledCache/ChronologicalEvictionStrategy.cs
/// <summary>
/// Given a cached message, indicates whether it should be purged from the cache.
/// </summary>
/// <param name="cachedMessage">The cached message.</param>
/// <param name="newestCachedMessage">The newest cached message.</param>
/// <param name="nowUtc">The current time (UTC).</param>
/// <returns><see langword="true" /> if the message should be purged, <see langword="false" /> otherwise.</returns>
Given a cached message, indicates whether it should be purged from the cache.
Given a cached message indicates whether it should be purged from the cache .
protected virtual bool ShouldPurge(ref CachedMessage cachedMessage, ref CachedMessage newestCachedMessage, DateTime nowUtc)
        {
            TimeSpan timeInCache = nowUtc - cachedMessage.DequeueTimeUtc;
            TimeSpan relativeAge = newestCachedMessage.EnqueueTimeUtc - cachedMessage.EnqueueTimeUtc;
            return timePurge.ShouldPurgeFromTime(timeInCache, relativeAge);
        }
protected virtual bool ShouldPurge ( ref CachedMessage cachedMessage , ref CachedMessage newestCachedMessage , DateTime nowUtc ) { TimeSpan timeInCache = nowUtc - cachedMessage . DequeueTimeUtc ; TimeSpan relativeAge = newestCachedMessage . EnqueueTimeUtc - cachedMessage . EnqueueTimeUtc ; return timePurge . ShouldPurgeFromTime ( timeInCache , relativeAge ) ; }
Given a cached message, indicates whether it should be purged from the cache.
Given a cached message indicates whether it should be purged from the cache .
// age of message relative to the most recent event in the cache.
if the message should be purged,  otherwise.
if the message should be purged otherwise .
CachedMessage
ref
nowUtc
DateTime
The current time (UTC).
The current time ( UTC ) .
cachedMessage
The cached message.
The cached message .
newestCachedMessage
The newest cached message.
The newest cached message .