Condividi tramite


ServiceBusProcessor.StartProcessingAsync(CancellationToken) Method

Definition

Signals the processor to begin processing messages. Should this method be called while the processor is already running, an InvalidOperationException is thrown.

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

Parameters

cancellationToken
CancellationToken

A CancellationToken instance to signal the request to cancel the start operation. This won't affect the processor once it starts running.

Returns

Exceptions

This can occur if the processor is already running. This can be checked via the IsProcessing property. This can also occur if event handlers have not been specified for the ProcessMessageAsync or the ProcessErrorAsync events.

Applies to