Documentation
¶
Overview ¶
Package taskconsumer consumes worker task messages and executes agent runs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestFromWorkerTask ¶
func RequestFromWorkerTask(msg protocol.WorkerTaskMessage) *agent.RequestContext
RequestFromWorkerTask converts the worker task protocol into the agent runtime boundary.
Types ¶
type Config ¶
type Config struct {
OrgID uint
WorkerID uint
Env string
DebounceWindow time.Duration
MaxConcurrency int // concurrent worker pool size, default 20
SeqTrackerPath string // path to SQLite seq tracker database
}
Config controls one standalone worker task consumer.
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer subscribes to one worker task topic and dispatches tasks to an agent runtime.
func New ¶
func New(cfg Config, subscriber eventbus.Subscriber, publisher ResultPublisher, runner agent.Runner, giteaCfg *config.GiteaConfig) (*Consumer, error)
New creates a worker task consumer.
func (*Consumer) Start ¶
Start subscribes to the worker task topic. On first start (no seq tracker or no history) it creates a durable consumer from the latest position. On restart with existing history it replays from the last terminal seq via SubscribeFrom, using SQLite as the authoritative recovery point. Only one subscription is active.
type MQStreamSink ¶
type MQStreamSink struct {
// contains filtered or unexported fields
}
MQStreamSink publishes agent runtime completion events via JetStream.
func NewMQStreamSink ¶
func NewMQStreamSink(publisher ResultPublisher, task protocol.WorkerTaskMessage) *MQStreamSink
NewMQStreamSink creates a stream sink for one worker task.
type ResultPublisher ¶
ResultPublisher publishes worker run result events.