你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

EventHubWebJobsExtensions.AddAsync 方法

定义

使用为分区分配提供的 partitionKey 添加要发布的 事件。

public static System.Threading.Tasks.Task AddAsync(this Microsoft.Azure.WebJobs.IAsyncCollector<Azure.Messaging.EventHubs.EventData> instance, Azure.Messaging.EventHubs.EventData eventData, string partitionKey, System.Threading.CancellationToken cancellationToken = default);
static member AddAsync : Microsoft.Azure.WebJobs.IAsyncCollector<Azure.Messaging.EventHubs.EventData> * Azure.Messaging.EventHubs.EventData * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function AddAsync (instance As IAsyncCollector(Of EventData), eventData As EventData, partitionKey As String, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

instance
Microsoft.Azure.WebJobs.IAsyncCollector<EventData>

调用此方法的 的实例 Microsoft.Azure.WebJobs.IAsyncCollector`1

eventData
EventData

要添加的事件

partitionKey
String

用于分区分配的分区键。 如果 null为 ,则使用轮循机制分区分配。

cancellationToken
CancellationToken

可用于取消操作的令牌。

返回

适用于