# ResponseCompletionSource Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.responsecompletionsource/)

## AsValueTask {#asvaluetask-e5bee824}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.responsecompletionsource/methods/asvaluetask-e5bee824/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/ResponseCompletionSource.cs#L22)

```csharp
public ValueTask<Response> AsValueTask()
```

Returns this instance as a `System.Threading.Tasks.ValueTask-1`.

### Returns

This instance, as a `System.Threading.Tasks.ValueTask-1`.

## AsVoidValueTask {#asvoidvaluetask-f797e0ef}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.responsecompletionsource/methods/asvoidvaluetask-f797e0ef/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/ResponseCompletionSource.cs#L28)

```csharp
public ValueTask AsVoidValueTask()
```

Returns this instance as a `System.Threading.Tasks.ValueTask`.

### Returns

This instance, as a `System.Threading.Tasks.ValueTask`.

## Complete {#complete-a5eec21c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.responsecompletionsource/methods/complete-a5eec21c/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/ResponseCompletionSource.cs#L76)

```csharp
public void Complete()
```

Completes this instance with the default result.

## Complete(Response) {#complete-orleans-serialization-invocation-response-b49fd446}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.responsecompletionsource/methods/complete-orleans-serialization-invocation-response-b49fd446/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/ResponseCompletionSource.cs#L71)

```csharp
public void Complete(Response value)
```

Completes this instance with a result.

### Parameters

- `value` (`Response`): The result value.

## GetResult(short) {#getresult-short-56ad1d88}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.responsecompletionsource/methods/getresult-short-56ad1d88/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/ResponseCompletionSource.cs#L81-L93)

```csharp
public Response GetResult(short token)
```

Gets the result of the `System.Threading.Tasks.Sources.IValueTaskSource-1`.

### Parameters

- `token` (`short`): An opaque value that was provided to the `System.Threading.Tasks.ValueTask` constructor.

### Returns

The result of the `System.Threading.Tasks.Sources.IValueTaskSource-1`.

## GetStatus(short) {#getstatus-short-0d974335}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.responsecompletionsource/methods/getstatus-short-0d974335/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/ResponseCompletionSource.cs#L31)

```csharp
public ValueTaskSourceStatus GetStatus(short token)
```

Gets the status of the current operation.

### Parameters

- `token` (`short`): Opaque value that was provided to the `System.Threading.Tasks.ValueTask`'s constructor.

### Returns

A value that indicates the status of the current operation.

## OnCompleted(Action&lt;object&gt;, object, short, ValueTaskSourceOnCompletedFlags) {#oncompleted-system-action-object-object-short-system-threading-tasks-sources-val-4726bd81}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.responsecompletionsource/methods/oncompleted-system-action-object-object-short-system-threading-tasks-sources-val-4726bd81/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/ResponseCompletionSource.cs#L34)

```csharp
public void OnCompleted(Action<object> continuation, object state, short token, ValueTaskSourceOnCompletedFlags flags)
```

Schedules the continuation action for this `System.Threading.Tasks.Sources.IValueTaskSource-1`.

### Parameters

- `continuation` (`Action<object>`): The continuation to invoke when the operation has completed.
- `state` (`object`): The state object to pass to `continuation` when it's invoked.
- `token` (`short`): An opaque value that was provided to the `System.Threading.Tasks.ValueTask` constructor.
- `flags` (`ValueTaskSourceOnCompletedFlags`): The flags describing the behavior of the continuation.

## Reset {#reset-6c0d17a4}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.responsecompletionsource/methods/reset-6c0d17a4/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/ResponseCompletionSource.cs#L41-L43)

```csharp
public void Reset()
```

Resets this instance.

## SetException(Exception) {#setexception-system-exception-4431d2dc}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.responsecompletionsource/methods/setexception-system-exception-4431d2dc/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/ResponseCompletionSource.cs#L49)

```csharp
public void SetException(Exception exception)
```

Completes this instance with an exception.

### Parameters

- `exception` (`Exception`): The exception.

## SetResult(Response) {#setresult-orleans-serialization-invocation-response-9b2606e0}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.invocation.responsecompletionsource/methods/setresult-orleans-serialization-invocation-response-9b2606e0/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Invocation/ResponseCompletionSource.cs#L57-L65)

```csharp
public void SetResult(Response result)
```

Completes this instance with a result.

### Parameters

- `result` (`Response`): The result.
