# IStreamQueueCheckpointer&lt;TCheckpoint&gt;.FlushAsync(CancellationToken)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.istreamqueuecheckpointer-1/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.istreamqueuecheckpointer-1/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/PersistentStreams/IStreamQueueCheckpointer.cs#L51)

```csharp
public virtual 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.
