# EventHubQueueCache Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubqueuecache/)

## Add(List&lt;EventData&gt;, DateTime) {#add-system-collections-generic-list-azure-messaging-eventhubs-eventdata-system-d-a45efe89}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubqueuecache/methods/add-system-collections-generic-list-azure-messaging-eventhubs-eventdata-system-d-a45efe89/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/EventHubQueueCache.cs#L117-L126)

```csharp
public List<StreamPosition> Add(List<EventData> messages, DateTime dequeueTimeUtc)
```

Add a list of EventHub EventData to the cache.

### Parameters

- `messages` (`List<EventData>`)
- `dequeueTimeUtc` (`DateTime`)

## AddCachePressureMonitor(ICachePressureMonitor) {#addcachepressuremonitor-orleans-streaming-eventhubs-icachepressuremonitor-e24e1031}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubqueuecache/methods/addcachepressuremonitor-orleans-streaming-eventhubs-icachepressuremonitor-e24e1031/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/EventHubQueueCache.cs#L88-L90)

```csharp
public void AddCachePressureMonitor(ICachePressureMonitor monitor)
```

Add cache pressure monitor to the cache's back pressure algorithm

### Parameters

- `monitor` (`ICachePressureMonitor`)

## Dispose {#dispose-7495593e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubqueuecache/methods/dispose-7495593e/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/EventHubQueueCache.cs#L98-L99)

```csharp
public void Dispose()
```

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

## GetCursor(StreamId, StreamSequenceToken) {#getcursor-orleans-runtime-streamid-orleans-streams-streamsequencetoken-4859a358}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubqueuecache/methods/getcursor-orleans-runtime-streamid-orleans-streams-streamsequencetoken-4859a358/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/EventHubQueueCache.cs#L137)

```csharp
public object GetCursor(StreamId streamId, StreamSequenceToken sequenceToken)
```

Get a cursor into the cache to read events from a stream.

### Parameters

- `streamId` (`StreamId`)
- `sequenceToken` (`StreamSequenceToken`)

## GetMaxAddCount {#getmaxaddcount-08e92a58}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubqueuecache/methods/getmaxaddcount-08e92a58/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/EventHubQueueCache.cs#L106)

```csharp
public int GetMaxAddCount()
```

The limit of the maximum number of items that can be added

## Refresh(object, StreamSequenceToken) {#refresh-object-orleans-streams-streamsequencetoken-048a9723}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubqueuecache/methods/refresh-object-orleans-streams-streamsequencetoken-048a9723/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/EventHubQueueCache.cs#L143-L144)

```csharp
public void Refresh(object cursor, StreamSequenceToken sequenceToken)
```

Refreshes an inactive cursor at the provided sequence token.

### Parameters

- `cursor` (`object`): The cursor to refresh.
- `sequenceToken` (`StreamSequenceToken`): The sequence token to position the cursor at.

## SignalPurge {#signalpurge-662a88d0}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubqueuecache/methods/signalpurge-662a88d0/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/EventHubQueueCache.cs#L79-L80)

```csharp
public void SignalPurge()
```

Send purge signal to the cache, the cache will perform a time based purge on its cached messages

## TryGetNextMessage(object, IBatchContainer) {#trygetnextmessage-object-out-orleans-streams-ibatchcontainer-32b072df}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubqueuecache/methods/trygetnextmessage-object-out-orleans-streams-ibatchcontainer-32b072df/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/EventHubQueueCache.cs#L154-L161)

```csharp
public bool TryGetNextMessage(object cursorObj, out IBatchContainer message)
```

Try to get the next message in the cache for the provided cursor.

### Parameters

- `cursorObj` (`object`)
- `message` (`IBatchContainer`)
