Share via


IEventProcessor Interface

Definition

Provides methods for event processors. Applications must implement this interface, which enables the handling of events from Event Hubs. This interface is the main extensibility point for the EventProcessorHost and RegisterProcessor<T>(Lease, ICheckpointManager).

public interface IEventProcessor
type IEventProcessor = interface
Public Interface IEventProcessor

Methods

CloseAsync(PartitionContext, CloseReason)

Called when the ownership of partition moves to a different node for load-balancing purpose, or when the host is shutting down. Called in response to UnregisterProcessorAsync(Lease, CloseReason).

OpenAsync(PartitionContext)

Initializes the Event Hub processor instance. This method is called before any event data is passed to this processor instance.

ProcessEventsAsync(PartitionContext, IEnumerable<EventData>)

Asynchronously processes the specified context and messages. This method is called when there are new messages in the Event Hubs stream. Make sure to checkpoint only when you are finished processing all the events in each batch.

Applies to