ChannelResponseQueue Class

Definition

Producer/consumer queue to read Activities sent by the Adapter during asynchronous background requests such as DeliveryMode.Stream/ExpectReplies.

public class ChannelResponseQueue
type ChannelResponseQueue = class
Public Class ChannelResponseQueue
Inheritance
ChannelResponseQueue

Remarks

StartHandlerForRequest and HandleResponsesAsync are called from the request thread. SendActivitiesAsync would ultimately be called from the background thread as Activities are sent through Adapter. CompleteHandlerForRequest is used to signal the queue for the request is complete and not further Activities will be queued.

Constructors

Name Description
ChannelResponseQueue(ILogger)

Producer/consumer queue to read Activities sent by the Adapter during asynchronous background requests such as DeliveryMode.Stream/ExpectReplies.

Methods

Name Description
CompleteHandlerForRequest(String)

Completes channel response handling synchronously. Blocks until all reads complete. Prefer CompleteHandlerForRequestAsync(String) when calling from an async context.

CompleteHandlerForRequestAsync(String)

Completes channel response handling asynchronously. Waits without blocking a thread pool thread.

HandleResponsesAsync(String, Func<IActivity,Task>, CancellationToken)

Processes queued responses. This blocks until CompleteHandlerForRequest is called.

SendActivitiesAsync(String, IActivity[], CancellationToken)

Called by the background processing to queue Activities. This will signal HandleResponsesAsync to process the Activities.

StartHandlerForRequest(String)

Starts the queue for a request. This MUST be called before background processing starts.

Applies to