# GrainStreamQueueCheckpointer Methods

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

## Create(string, string, string, IClusterClient) {#create-string-string-string-orleans-iclusterclient-dae2f14f}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.grainstreamqueuecheckpointer/methods/create-string-string-string-orleans-iclusterclient-dae2f14f/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointer.cs)

```csharp
[System.Obsolete(Use the overload which accepts a CancellationToken.)]
public static Task<IStreamQueueCheckpointer<string>> Create(string providerName, string partition, string serviceId, IClusterClient clusterClient)
```

Creates and initializes a grain-based checkpointer with default options.

### Parameters

- `providerName` (`string`)
- `partition` (`string`)
- `serviceId` (`string`)
- `clusterClient` (`IClusterClient`)

## Create(string, string, string, IClusterClient, CancellationToken) {#create-string-string-string-orleans-iclusterclient-system-threading-cancellation-54264c9b}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.grainstreamqueuecheckpointer/methods/create-string-string-string-orleans-iclusterclient-system-threading-cancellation-54264c9b/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointer.cs)

```csharp
public static Task<IStreamQueueCheckpointer<string>> Create(string providerName, string partition, string serviceId, IClusterClient clusterClient, CancellationToken cancellationToken)
```

Creates and initializes a grain-based checkpointer with default options.

### Parameters

- `providerName` (`string`)
- `partition` (`string`)
- `serviceId` (`string`)
- `clusterClient` (`IClusterClient`)
- `cancellationToken` (`CancellationToken`)

## Create(string, string, string, IClusterClient, GrainStreamQueueCheckpointerOptions) {#create-string-string-string-orleans-iclusterclient-orleans-configuration-grainst-28265e6c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.grainstreamqueuecheckpointer/methods/create-string-string-string-orleans-iclusterclient-orleans-configuration-grainst-28265e6c/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointer.cs)

```csharp
[System.Obsolete(Use the overload which accepts a CancellationToken.)]
public static Task<IStreamQueueCheckpointer<string>> Create(string providerName, string partition, string serviceId, IClusterClient clusterClient, GrainStreamQueueCheckpointerOptions options)
```

Creates and initializes a grain-based checkpointer.

### Parameters

- `providerName` (`string`)
- `partition` (`string`)
- `serviceId` (`string`)
- `clusterClient` (`IClusterClient`)
- `options` (`GrainStreamQueueCheckpointerOptions`)

## Create(string, string, string, IClusterClient, GrainStreamQueueCheckpointerOptions, CancellationToken) {#create-string-string-string-orleans-iclusterclient-orleans-configuration-grainst-2f8af81e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.grainstreamqueuecheckpointer/methods/create-string-string-string-orleans-iclusterclient-orleans-configuration-grainst-2f8af81e/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointer.cs)

```csharp
public static Task<IStreamQueueCheckpointer<string>> Create(string providerName, string partition, string serviceId, IClusterClient clusterClient, GrainStreamQueueCheckpointerOptions options, CancellationToken cancellationToken)
```

Creates and initializes a grain-based checkpointer.

### Parameters

- `providerName` (`string`)
- `partition` (`string`)
- `serviceId` (`string`)
- `clusterClient` (`IClusterClient`)
- `options` (`GrainStreamQueueCheckpointerOptions`)
- `cancellationToken` (`CancellationToken`)

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

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

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointer.cs#L233-L276)

```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-7f687fec}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.grainstreamqueuecheckpointer/methods/load-7f687fec/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointer.cs#L182)

```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-04080c92}

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

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointer.cs#L182)

```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-dece0aec}

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

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointer.cs#L200)

```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-c97b9d9e}

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

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointer.cs#L205-L228)

```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.
