Table of Contents

Delegate NextDelegate

Namespace
Microsoft.Agents.Builder
Assembly
Microsoft.Agents.Builder.dll

Encapsulates an asynchronous method that calls the next IMiddleware.OnTurnAsync(ITurnContext, NextDelegate, CancellationToken) or IAgent.OnTurnAsync(ITurnContext, CancellationToken) method in the middleware pipeline.

public delegate Task NextDelegate(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task

A task that represents the work queued to execute.

Constructors

NextDelegate(object, nint)

public NextDelegate(object @object, nint method)

Parameters

object object
method nint

Methods

BeginInvoke(CancellationToken, AsyncCallback, object)

public virtual IAsyncResult BeginInvoke(CancellationToken cancellationToken, AsyncCallback callback, object @object)

Parameters

cancellationToken CancellationToken
callback AsyncCallback
object object

Returns

IAsyncResult

EndInvoke(IAsyncResult)

public virtual Task EndInvoke(IAsyncResult result)

Parameters

result IAsyncResult

Returns

Task

Invoke(CancellationToken)

public virtual Task Invoke(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task