다음을 통해 공유


EventHubReceiver.ReceiveAsync Method

Definition

Overloads

ReceiveAsync()

Asynchronous version of Receive().

ReceiveAsync(Int32)

Asynchronous version of Receive(Int32).

ReceiveAsync(TimeSpan)

Asynchronous version of Receive(TimeSpan).

ReceiveAsync(Int32, TimeSpan)

Asynchronous version of Receive(Int32, TimeSpan).

ReceiveAsync()

Asynchronous version of Receive().

public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventData> ReceiveAsync ();
member this.ReceiveAsync : unit -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventData>
Public Function ReceiveAsync () As Task(Of EventData)

Returns

The task representing the asynchronous operation.

Applies to

ReceiveAsync(Int32)

Asynchronous version of Receive(Int32).

public System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.ServiceBus.Messaging.EventData>> ReceiveAsync (int maxCount);
member this.ReceiveAsync : int -> System.Threading.Tasks.Task<seq<Microsoft.ServiceBus.Messaging.EventData>>
Public Function ReceiveAsync (maxCount As Integer) As Task(Of IEnumerable(Of EventData))

Parameters

maxCount
Int32

The maximum amount of event data the user is willing to accept in one call.

Returns

Returns Task<TResult>.

Remarks

Service does not wait for maxCount events to be filled before returning to user. It returns as soon as there are any events available.

Applies to

ReceiveAsync(TimeSpan)

Asynchronous version of Receive(TimeSpan).

public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventData> ReceiveAsync (TimeSpan waitTime);
member this.ReceiveAsync : TimeSpan -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.EventData>
Public Function ReceiveAsync (waitTime As TimeSpan) As Task(Of EventData)

Parameters

waitTime
TimeSpan

The maximum time the user is willing to wait for event data to arrive.

Returns

The task representing the asynchronous operation.

Remarks

waitTime is not a guaranteed wait time, as API will return data as soon as it is available.

Applies to

ReceiveAsync(Int32, TimeSpan)

Asynchronous version of Receive(Int32, TimeSpan).

public System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.ServiceBus.Messaging.EventData>> ReceiveAsync (int maxCount, TimeSpan waitTime);
member this.ReceiveAsync : int * TimeSpan -> System.Threading.Tasks.Task<seq<Microsoft.ServiceBus.Messaging.EventData>>
Public Function ReceiveAsync (maxCount As Integer, waitTime As TimeSpan) As Task(Of IEnumerable(Of EventData))

Parameters

maxCount
Int32

The maximum amount of event data the user is willing to accept in one call.

waitTime
TimeSpan

The maximum time the user is willing to wait for event data to arrive.

Returns

Returns Task<TResult>.

Remarks

waitTime is not a guaranteed wait time, as API will return data as soon as it is available. Also service does not wait for maxCount events to be filled before returning to user. It returns as soon as there are any events available.

Applies to