Skip to content

IEventHubQueueCache Methods

Interface for a stream message cache that stores EventHub EventData

Add(List<EventData>, DateTime)

abstract
public abstract List<StreamPosition> Add(List<EventData> message, DateTime dequeueTimeUtc)
Add a list of EventHub EventData to the cache.

Parameters

messageList<EventData>
dequeueTimeUtcDateTime

AddCachePressureMonitor(ICachePressureMonitor)

abstract
public abstract void AddCachePressureMonitor(ICachePressureMonitor monitor)
Add cache pressure monitor to the cache's back pressure algorithm

Parameters

monitorICachePressureMonitor

GetCursor(StreamId, StreamSequenceToken?)

abstract
[System.Obsolete(Use TryGetCursor instead.)]
public abstract object GetCursor(StreamId streamId, StreamSequenceToken? sequenceToken)
Get a cursor into the cache to read events from a stream.

Parameters

streamIdStreamId
The stream identifier.
sequenceTokenStreamSequenceToken?
The position from which to begin reading.

Returns

The acquired cache cursor.

Exceptions

Orleans.Streams.QueueCacheMissException
The requested token is older than the messages retained by the cache.

Refresh(object, StreamSequenceToken?)

virtual
View source
public virtual void Refresh(object cursor, StreamSequenceToken? sequenceToken)
Refreshes an inactive cursor at the provided sequence token.

Parameters

cursorobject
The cursor to refresh.
sequenceTokenStreamSequenceToken?
The sequence token to position the cursor at.

SignalPurge

abstract
public abstract void SignalPurge()
Send purge signal to the cache, the cache will perform a time based purge on its cached messages

TryGetCursor(StreamId, StreamSequenceToken?)

virtual
View source
public virtual QueueCacheCursorResult<object> TryGetCursor(StreamId streamId, StreamSequenceToken? sequenceToken)
Attempts to get a cursor into the cache to read events from a stream.

Parameters

streamIdStreamId
The stream identifier.
sequenceTokenStreamSequenceToken?
The position from which to begin reading.

Returns

A successful result containing the acquired cursor, or a cache-miss result containing the unavailable position and current cache bounds.

TryGetCursorAtPosition(StreamId, StreamSubscriptionStartPosition)

virtual
View source
public virtual QueueCacheCursorResult<object> TryGetCursorAtPosition(StreamId streamId, StreamSubscriptionStartPosition startPosition)
Attempts to get a cursor into the cache at the specified subscription start position.

Parameters

streamIdStreamId
The stream identifier.
startPositionStreamSubscriptionStartPosition
The initial subscription position.

Returns

A successful result containing the acquired cursor, a cache-miss result containing the unavailable position and current cache bounds, or QueueCacheCursorResultKind.

Exceptions

System.ArgumentOutOfRangeException
startPosition is not defined.

TryGetNextMessage(object, IBatchContainer?)

abstract
[System.Obsolete(Use TryGetNextMessageWithResult instead.)]
public abstract bool TryGetNextMessage(object cursorObj, out IBatchContainer? message)
Try to get the next message in the cache for the provided cursor.

Parameters

cursorObjobject
The cache cursor.
messageIBatchContainer?
The next message when one is available.

Returns

true when a message was returned; otherwise, false.

Exceptions

Orleans.Streams.QueueCacheMissException
The cursor position is older than the messages retained by the cache.

TryGetNextMessageWithResult(object, IBatchContainer?)

virtual
View source
public virtual QueueCacheCursorMoveResult TryGetNextMessageWithResult(object cursorObj, out IBatchContainer? message)
Attempts to get the next message in the cache for the provided cursor.

Parameters

cursorObjobject
The cache cursor.
messageIBatchContainer?
The next message when one is available.

Returns

A successful result with a non-null message, QueueCacheCursorMoveResultKind with a null message, or a cache-miss result with a null message.