Udostępnij za pośrednictwem


EventProcessorClient.StopProcessingAsync(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 System.Threading.Tasks.Task StopProcessingAsync (System.Threading.CancellationToken cancellationToken = default);
override this.StopProcessingAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overrides 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 EventProcessorClient 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