共用方式為


EventProcessorClient.PartitionClosingAsync Event

Definition

Performs the tasks needed when processing for a partition is being stopped. This commonly occurs when the partition is claimed by another event processor instance or when the current event processor instance is shutting down.

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.

public event Func<Azure.Messaging.EventHubs.Processor.PartitionClosingEventArgs,System.Threading.Tasks.Task> PartitionClosingAsync;
member this.PartitionClosingAsync : Func<Azure.Messaging.EventHubs.Processor.PartitionClosingEventArgs, System.Threading.Tasks.Task> 
Public Custom Event PartitionClosingAsync As Func(Of PartitionClosingEventArgs, Task) 

Event Type

Exceptions

If an attempt is made to remove a handler that doesn't match the current handler registered.

If an attempt is made to add a handler when one is currently registered.

Remarks

This handler will be invoked concurrently, as each close is independent. No time limit is imposed on an invocation of this handler; it is safe for implementations to perform long-running operations and retries as needed. This handler has no influence on processing for the associated partition and offers no guarantee that execution will complete before processing for the partition is restarted or migrates to a new host.

Applies to

See also