Table of Contents

Delegate Container.ChangeFeedHandlerWithManualCheckpoint<T>

Namespace
Microsoft.Azure.Cosmos
Assembly
Microsoft.Azure.Cosmos.Client.dll

Delegate to receive the changes within a ChangeFeedProcessor execution with manual checkpoint.

public delegate Task Container.ChangeFeedHandlerWithManualCheckpoint<T>(ChangeFeedProcessorContext context, IReadOnlyCollection<T> changes, Func<Task> checkpointAsync, CancellationToken cancellationToken)

Parameters

context ChangeFeedProcessorContext

The context related to the changes.

changes IReadOnlyCollection<T>

The changes that happened.

checkpointAsync Func<Task>

A task representing an asynchronous checkpoint on the progress of a lease.

cancellationToken CancellationToken

A cancellation token representing the current cancellation status of the ChangeFeedProcessor instance.

Returns

Task

A Task representing the asynchronous operation that is going to be done with the changes.

Type Parameters

T
Extension Methods

Examples

(ChangeFeedProcessorContext context, IReadOnlyCollection<T> changes, Func<Task> checkpointAsync, CancellationToken cancellationToken) =>
{
    // consume changes

    // On certain condition, we can checkpoint
    await checkpointAsync();
}

Constructors

ChangeFeedHandlerWithManualCheckpoint(object, nint)

public ChangeFeedHandlerWithManualCheckpoint(object @object, nint method)

Parameters

object object
method nint

Methods

BeginInvoke(ChangeFeedProcessorContext, IReadOnlyCollection<T>, Func<Task>, CancellationToken, AsyncCallback, object)

public virtual IAsyncResult BeginInvoke(ChangeFeedProcessorContext context, IReadOnlyCollection<T> changes, Func<Task> checkpointAsync, CancellationToken cancellationToken, AsyncCallback callback, object @object)

Parameters

context ChangeFeedProcessorContext
changes IReadOnlyCollection<T>
checkpointAsync Func<Task>
cancellationToken CancellationToken
callback AsyncCallback
object object

Returns

IAsyncResult

EndInvoke(IAsyncResult)

public virtual Task EndInvoke(IAsyncResult result)

Parameters

result IAsyncResult

Returns

Task

Invoke(ChangeFeedProcessorContext, IReadOnlyCollection<T>, Func<Task>, CancellationToken)

public virtual Task Invoke(ChangeFeedProcessorContext context, IReadOnlyCollection<T> changes, Func<Task> checkpointAsync, CancellationToken cancellationToken)

Parameters

context ChangeFeedProcessorContext
changes IReadOnlyCollection<T>
checkpointAsync Func<Task>
cancellationToken CancellationToken

Returns

Task