src/Orleans.Streaming/Common/SimpleCache/SimpleQueueCache.cs
/// <summary>
/// Acquires the next message in the cache at the provided cursor
/// </summary>
/// <param name="cursor"></param>
/// <param name="batch"></param>
/// <returns></returns>
Acquires the next message in the cache at the provided cursor
Acquires the next message in the cache at the provided cursor
internal bool TryGetNextMessage(SimpleQueueCacheCursor cursor, out IBatchContainer batch)
        {
            if (logger.IsEnabled(LogLevel.Debug))
            {
                logger.LogDebug("TryGetNextMessage: {Cursor}", cursor);
            }
            batch = null;
            if (!cursor.IsSet) return false;
            if (cursor.Element == cachedMessages.First)
            {
                UnsetCursor(cursor, null);
            }
            else 
            {
                AdvanceCursor(cursor, cursor.Element.Previous);
            }
            batch = cursor.Element?.Value.Batch;
            return (batch != null);
        }
internal bool TryGetNextMessage ( SimpleQueueCacheCursor cursor , out IBatchContainer batch ) { if ( logger . IsEnabled ( LogLevel . Debug ) ) { logger . LogDebug ( " " , cursor ) ; } batch = null ; if ( ! cursor . IsSet ) return false ; if ( cursor . Element == cachedMessages . First ) { UnsetCursor ( cursor , null ) ; } else { AdvanceCursor ( cursor , cursor . Element . Previous ) ; } batch = cursor . Element ? . Value . Batch ; return ( batch != null ) ; }
Acquires the next message in the cache at the provided cursor
Acquires the next message in the cache at the provided cursor
// If we are at the end of the cache unset cursor and move offset one forward // Advance to next:
None
cursor
SimpleQueueCacheCursor
None
IBatchContainer
out
batch
None