Share via


EventProcessorClient.OnInitializingPartitionAsync Method

Definition

Performs the tasks to initialize a partition, and its associated context, for event processing.

protected override System.Threading.Tasks.Task OnInitializingPartitionAsync (Azure.Messaging.EventHubs.Primitives.EventProcessorPartition partition, System.Threading.CancellationToken cancellationToken);
override this.OnInitializingPartitionAsync : Azure.Messaging.EventHubs.Primitives.EventProcessorPartition * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected Overrides Function OnInitializingPartitionAsync (partition As EventProcessorPartition, cancellationToken As CancellationToken) As Task

Parameters

partition
EventProcessorPartition

The context of the partition being initialized. Only the well-known members of the EventProcessorPartition will be populated. If a custom context is being used, the implementor of this method is responsible for initializing custom members.

cancellationToken
CancellationToken

A CancellationToken instance to signal the request to cancel the initialization. This is most likely to occur if the partition is claimed by another event processor instance or the processor is shutting down.

Returns

Remarks

It is not recommended that the state of the processor be managed directly from within this method; requesting to start or stop the processor may result in a deadlock scenario, especially if using the synchronous form of the call.

Applies to