Dela via


EventHubsModelFactory.EventDataBatch Method

Definition

public static Azure.Messaging.EventHubs.Producer.EventDataBatch EventDataBatch (long batchSizeBytes, System.Collections.Generic.IList<Azure.Messaging.EventHubs.EventData> batchEventStore, Azure.Messaging.EventHubs.Producer.CreateBatchOptions batchOptions = default, Func<Azure.Messaging.EventHubs.EventData,bool> tryAddCallback = default);
static member EventDataBatch : int64 * System.Collections.Generic.IList<Azure.Messaging.EventHubs.EventData> * Azure.Messaging.EventHubs.Producer.CreateBatchOptions * Func<Azure.Messaging.EventHubs.EventData, bool> -> Azure.Messaging.EventHubs.Producer.EventDataBatch
Public Shared Function EventDataBatch (batchSizeBytes As Long, batchEventStore As IList(Of EventData), Optional batchOptions As CreateBatchOptions = Nothing, Optional tryAddCallback As Func(Of EventData, Boolean) = Nothing) As EventDataBatch

Parameters

batchSizeBytes
Int64

The size, in bytes, that the batch should report; this is a static value and will not mutate as events are added.

batchEventStore
IList<EventData>

A list to which events will be added when TryAdd(EventData) calls are successful.

batchOptions
CreateBatchOptions

The set of options to consider when creating this batch.

tryAddCallback
Func<EventData,Boolean>

A function that will be invoked when TryAdd(EventData) is called; the return of this callback represents the result of TryAdd(EventData). If not provided, all events will be accepted into the batch.

Returns

The EventDataBatch(Int64, IList<EventData>, CreateBatchOptions, Func<EventData,Boolean>) instance that was created.

Remarks

It is important to note that the batch will keep an internal copy of events accepted by TryAdd(EventData); changes made to batchEventStore outside of the batch will not be reflected by the batch.

Applies to