Share via


EventProcessor<TPartition>.StopProcessingAsync Method

Definition

Signals the EventProcessor<TPartition> to stop processing events. Should this method be called while the processor is not running, no action is taken.

public virtual System.Threading.Tasks.Task StopProcessingAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member StopProcessingAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.StopProcessingAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function StopProcessingAsync (Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

cancellationToken
CancellationToken

A CancellationToken instance to signal the request to cancel the stop operation. If the operation is successfully canceled, the EventProcessor<TPartition> will keep running.

Returns

Remarks

When stopping, the processor will update the ownership of partitions that it was responsible for processing and clean up network resources used for communication with the Event Hubs service. As a result, this method will perform network I/O and may need to wait for partition reads that were active to complete.

Due to service calls and network latency, an invocation of this method may take slightly longer than the specified MaximumWaitTime or if the wait time was not configured, the duration of the TryTimeout of the configured retry policy.

Applies to