CloudAdapter.HostResponseAsync Method

Definition

Processes an outgoing activity in response to an incoming activity, handling delivery modes that require immediate response from the host.

protected override System.Threading.Tasks.Task<bool> HostResponseAsync(Microsoft.Agents.Core.Models.IActivity incomingActivity, Microsoft.Agents.Core.Models.IActivity outActivity, System.Threading.CancellationToken cancellationToken);
override this.HostResponseAsync : Microsoft.Agents.Core.Models.IActivity * Microsoft.Agents.Core.Models.IActivity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Protected Overrides Function HostResponseAsync (incomingActivity As IActivity, outActivity As IActivity, cancellationToken As CancellationToken) As Task(Of Boolean)

Parameters

incomingActivity
IActivity

The incoming activity that triggered the response. The delivery mode of this activity determines how the response is handled.

outActivity
IActivity

The activity to be sent as a response to the incoming activity.

cancellationToken
CancellationToken

A cancellation token that can be used to cancel the asynchronous operation.

Returns

A task that represents the asynchronous operation. The task result is true if the response was handled by the host; otherwise, false.

Remarks

This method handles activities with delivery modes Stream and ExpectReplies by sending the response activity through the response queue. For other delivery modes, the method returns false and does not process the response.

Applies to