# AwaitResponse Method

## Overloads

| [AwaitResponse<T>(Task<T>, String, CancellationToken)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.QlikConnection.AwaitResponse.htm#Qlik_Engine_Communication_QlikConnection_AwaitResponse__1_System_Threading_Tasks_Task___0__System_String_System_Threading_CancellationToken_) |  | Await the arrival of a response for a method call to the engine. |
| --- | --- | --- |
| [AwaitResponse(Task, String, CancellationToken)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.QlikConnection.AwaitResponse.htm#Qlik_Engine_Communication_QlikConnection_AwaitResponse_System_Threading_Tasks_Task_System_String_System_Threading_CancellationToken_) |  | Await the arrival of a response for a method call to the engine. |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.QlikConnection.AwaitResponse.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.QlikConnection.AwaitResponse.htm)

## AwaitResponse&lt;T&gt;(Task&lt;T&gt;, String, CancellationToken)

Await the arrival of a response for a method call to the engine.

### Declaration

```

          public static T AwaitResponse<T>(Task<T> task, string methodName, CancellationToken cancellationToken)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.Threading.Tasks.Task&lt;T&gt; | task | The task returned by a call to SendAsync. |
| System.String | methodName | The name of the method that the task corresponds to. |
| System.Threading.CancellationToken | cancellationToken | The token used to synchronize shutdown events. |

### Returns

| Type | Description |
| --- | --- |
| T | The value returned by the task. |

### Type Parameters

| Name | Description |
| --- | --- |
| T | The return type of the method. |

### Exceptions

| Type | Condition |
| --- | --- |
| System.TimeoutException | Throws a timeout exception if a response has not been received<br>within the current timeout. |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.QlikConnection.AwaitResponse.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.QlikConnection.AwaitResponse.htm)

## AwaitResponse(Task, String, CancellationToken)

Await the arrival of a response for a method call to the engine.

### Declaration

```

          public static void AwaitResponse(Task task, string methodName, CancellationToken cancellationToken)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.Threading.Tasks.Task | task | The task returned by a call to SendAsync. |
| System.String | methodName | The name of the method that the task corresponds to. |
| System.Threading.CancellationToken | cancellationToken | The token used to synchronize shutdown events. |

### Exceptions

| Type | Condition |
| --- | --- |
| System.TimeoutException | Throws a timeout exception if a response has not been received<br>within the current timeout. |