EventProcessorClient.StopProcessing(CancellationToken) Method

Definition

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

public override void StopProcessing (System.Threading.CancellationToken cancellationToken = default);
override this.StopProcessing : System.Threading.CancellationToken -> unit
Public Overrides 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 EventProcessorClient 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