你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
IEventProcessor 接口
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供事件处理程序的方法。 应用程序必须实现此接口,以便处理来自事件中心的事件。 此接口是 EventProcessorHost 和 RegisterProcessor<T>(Lease, ICheckpointManager)的main扩展点。
public interface IEventProcessor
type IEventProcessor = interface
Public Interface IEventProcessor
方法
CloseAsync(PartitionContext, CloseReason) |
当分区的所有权移到其他节点以实现负载均衡时或主机关闭时调用。 调用 以响应 UnregisterProcessorAsync(Lease, CloseReason)。 |
OpenAsync(PartitionContext) |
初始化事件中心处理器实例。 在将任何事件数据传递到此处理器实例之前,将调用此方法。 |
ProcessEventsAsync(PartitionContext, IEnumerable<EventData>) |
异步处理指定的上下文和消息。 当事件中心流中存在新消息时,将调用此方法。 确保仅在处理完每个批处理中的所有事件后才使用检查点。 |