Share via


EventGridReceiverClient.ReceiveAsync Method

Definition

Receive a batch of Cloud Events from a subscription.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Messaging.EventGrid.Namespaces.ReceiveResult>> ReceiveAsync (int? maxEvents = default, TimeSpan? maxWaitTime = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ReceiveAsync : Nullable<int> * Nullable<TimeSpan> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Messaging.EventGrid.Namespaces.ReceiveResult>>
override this.ReceiveAsync : Nullable<int> * Nullable<TimeSpan> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Messaging.EventGrid.Namespaces.ReceiveResult>>
Public Overridable Function ReceiveAsync (Optional maxEvents As Nullable(Of Integer) = Nothing, Optional maxWaitTime As Nullable(Of TimeSpan) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ReceiveResult))

Parameters

maxEvents
Nullable<Int32>

Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1.

maxWaitTime
Nullable<TimeSpan>

Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Applies to