Table of Contents

Class DefaultCloudEventBatchProcessor

Namespace
Excalibur.Dispatch.CloudEvents
Assembly
Excalibur.Dispatch.dll

Default implementation of CloudEvent batch processor.

public sealed class DefaultCloudEventBatchProcessor : ICloudEventBatchProcessor
Inheritance
DefaultCloudEventBatchProcessor
Implements
Inherited Members
Extension Methods

Constructors

DefaultCloudEventBatchProcessor(CloudEventBatchOptions, IDispatcher, IServiceProvider)

Default implementation of CloudEvent batch processor.

public DefaultCloudEventBatchProcessor(CloudEventBatchOptions batchOptions, IDispatcher dispatcher, IServiceProvider serviceProvider)

Parameters

batchOptions CloudEventBatchOptions

Options used for batch size and thresholds.

dispatcher IDispatcher

Dispatch pipeline used to dispatch converted events.

serviceProvider IServiceProvider

Service provider used to build message contexts.

Methods

CreateBatches(IEnumerable<IDispatchEvent>, IMessageContext)

Creates batches of CloudEvents from a collection of dispatch events based on the configured batch options.

public IReadOnlyList<CloudEventBatch> CreateBatches(IEnumerable<IDispatchEvent> events, IMessageContext context)

Parameters

events IEnumerable<IDispatchEvent>

The dispatch events to batch.

context IMessageContext

The message context containing metadata.

Returns

IReadOnlyList<CloudEventBatch>

A collection of CloudEvent batches ready for processing.

ProcessBatchAsync(CloudEventBatch, CancellationToken)

Processes a batch of CloudEvents by converting them back to dispatch events and dispatching them.

public Task ProcessBatchAsync(CloudEventBatch batch, CancellationToken cancellationToken)

Parameters

batch CloudEventBatch

The CloudEvent batch to process.

cancellationToken CancellationToken

A cancellation token to cancel the operation.

Returns

Task

A task representing the asynchronous processing operation.