eventengine

package
v0.1.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

README

Orchestrator

Orchestrator 是 Leros 的核心组件之一,负责消费由各种连接器(如 GitHub)发布的事件,并执行相应的业务逻辑。

功能特性

  • 监听 RabbitMQ 中的各种主题(topics)
  • 对 GitHub 事件的实时处理
  • 支持多种事件类型的消费者模型
  • 可扩展的处理器注册机制

当前支持的事件类型

  • interaction.github.issue_comment: GitHub 问题评论事件
  • interaction.github.pull_request: GitHub PR 事件

如何使用

Orchestrator 在 Leros 后台服务启动时同时启动,并自动订阅配置好的事件主题。

架构原理

  1. 各个连接器(connectors)接收到的外部事件被标准化为 interaction.Event 格式
  2. 这些事件通过 eventbus 发送到相应的话题(topic)
  3. Orchestrator 订阅这些话题并处理事件
  4. 后续可以在此基础上增加业务逻辑执行、技能调用等功能

Documentation

Overview

Package eventengine subscribes to interaction events and dispatches agent runs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandlerFunc

type EventHandlerFunc func(ctx context.Context, event *interactionevent.Event) error

EventHandlerFunc handles one normalized interaction event.

type Orchestrator

type Orchestrator struct {
	// contains filtered or unexported fields
}

Orchestrator subscribes to interaction event topics and dispatches them to the agent runtime.

func NewOrchestrator

func NewOrchestrator(subscriber eventbus.Subscriber, runner agent.Runner) *Orchestrator

NewOrchestrator creates a new event orchestrator.

func (*Orchestrator) GetHandler

func (o *Orchestrator) GetHandler(topic string) (EventHandlerFunc, error)

GetHandler returns the handler registered for a topic.

func (*Orchestrator) RegisterHandler

func (o *Orchestrator) RegisterHandler(topic string, handler EventHandlerFunc)

RegisterHandler registers an event handler for a topic.

func (*Orchestrator) Start

func (o *Orchestrator) Start(ctx context.Context) error

Start starts subscriptions for registered event topics.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL