Skip to content

GeneratorPooledCache Methods

Pooled cache for generator stream provider.

GetBatchContainer(CachedMessage)

View source
public IBatchContainer GetBatchContainer(ref CachedMessage cachedMessage)
Converts a cached message to a batch container for delivery

Parameters

cachedMessageCachedMessage
The cached message.

Returns

The batch container.

GetCacheCursor(StreamId, StreamSequenceToken)

View source
public IQueueCacheCursor GetCacheCursor(StreamId streamId, StreamSequenceToken token)
Acquire a stream message cursor. This can be used to retrieve messages from the cache starting at the location indicated by the provided token.

Parameters

streamIdStreamId
The stream identifier.
tokenStreamSequenceToken
The token.

Returns

The queue cache cursor.

GetMaxAddCount

View source
public int GetMaxAddCount()
Gets the maximum number of items that can be added.

Returns

The maximum number of items that can be added.

GetSequenceToken(CachedMessage)

View source
public StreamSequenceToken GetSequenceToken(ref CachedMessage cachedMessage)
Gets the stream sequence token from a cached message.

Parameters

cachedMessageCachedMessage
The cached message.

Returns

The sequence token.

IsUnderPressure

View source
public bool IsUnderPressure()
Returns true if this cache is under pressure, false otherwise.

Returns

true if this cache is under pressure; otherwise, false.

TryPurgeFromCache(IList<IBatchContainer>)

View source
public bool TryPurgeFromCache(out IList<IBatchContainer> purgedItems)
Requests that the cache purge any items that can be purged.

Parameters

purgedItemsIList<IBatchContainer>
The purged items.

Returns

true if items were successfully purged from the cache., false otherwise.