Share via


EventProcessor<TPartition>.StopProcessing(CancellationToken) 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 void StopProcessing (System.Threading.CancellationToken cancellationToken = default);
abstract member StopProcessing : System.Threading.CancellationToken -> unit
override this.StopProcessing : System.Threading.CancellationToken -> unit
Public Overridable Sub StopProcessing (Optional cancellationToken As CancellationToken = Nothing)

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.

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