# StreamQueueCheckpointer Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamqueuecheckpointer/)

## FlushAsync(CancellationToken) {#flushasync-system-threading-cancellationtoken-f3db2ee8}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamqueuecheckpointer/methods/flushasync-system-threading-cancellationtoken-f3db2ee8/)

[Source](https://github.com/dotnet/orleans/blob/8bc9fd244427351ad24ccc039a9e7642a42c1cc4/src/Orleans.Streaming/Checkpointers/StreamQueueCheckpointer.cs#L122-L165)

```csharp
public Task FlushAsync(CancellationToken cancellationToken)
```

Flushes any pending checkpoint to persistent storage, ensuring the latest offset is durably saved. Called during shutdown or rebalancing to prevent message replay on restart.

### Parameters

- `cancellationToken` (`CancellationToken`): The cancellation token.

### Returns

A `System.Threading.Tasks.Task` representing the flush operation.

## Load {#load-390c845f}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamqueuecheckpointer/methods/load-390c845f/)

[Source](https://github.com/dotnet/orleans/blob/8bc9fd244427351ad24ccc039a9e7642a42c1cc4/src/Orleans.Streaming/Checkpointers/StreamQueueCheckpointer.cs#L56)

```csharp
[System.Obsolete(Use the overload which accepts a CancellationToken.)]
public Task<string> Load()
```

Loads the checkpoint.

### Returns

The checkpoint.

## Load(CancellationToken) {#load-system-threading-cancellationtoken-af69f4b7}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamqueuecheckpointer/methods/load-system-threading-cancellationtoken-af69f4b7/)

[Source](https://github.com/dotnet/orleans/blob/8bc9fd244427351ad24ccc039a9e7642a42c1cc4/src/Orleans.Streaming/Checkpointers/StreamQueueCheckpointer.cs#L56)

```csharp
public Task<string> Load(CancellationToken cancellationToken)
```

Loads the checkpoint.

### Parameters

- `cancellationToken` (`CancellationToken`): The cancellation token.

### Returns

The checkpoint.

## Update(string, DateTime) {#update-string-system-datetime-e7e1284b}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamqueuecheckpointer/methods/update-string-system-datetime-e7e1284b/)

[Source](https://github.com/dotnet/orleans/blob/8bc9fd244427351ad24ccc039a9e7642a42c1cc4/src/Orleans.Streaming/Checkpointers/StreamQueueCheckpointer.cs#L74)

```csharp
[System.Obsolete(Use the overload which accepts a CancellationToken.)]
public void Update(string offset, DateTime utcNow)
```

Updates the checkpoint.

### Parameters

- `offset` (`string`): The offset.
- `utcNow` (`DateTime`): The current UTC time.

## Update(string, DateTime, CancellationToken) {#update-string-system-datetime-system-threading-cancellationtoken-cb7e82b7}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamqueuecheckpointer/methods/update-string-system-datetime-system-threading-cancellationtoken-cb7e82b7/)

[Source](https://github.com/dotnet/orleans/blob/8bc9fd244427351ad24ccc039a9e7642a42c1cc4/src/Orleans.Streaming/Checkpointers/StreamQueueCheckpointer.cs#L79-L117)

```csharp
public void Update(string offset, DateTime utcNow, CancellationToken cancellationToken)
```

Updates the checkpoint.

### Parameters

- `offset` (`string`): The offset.
- `utcNow` (`DateTime`): The current UTC time.
- `cancellationToken` (`CancellationToken`): The cancellation token.
