merge

package
v0.3.0-20260803204450-... Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package merge implements the trigger stage for the asynchronous merge. It consumes a batch ready to land, builds the full merge request from the batch's member requests (one step per request, in Contains order), and publishes it to runway's merge queue using the batch id as the client-owned correlation id. Runway performs the merge out of process and publishes the result to the merge-signal queue, which the mergesignal stage consumes and correlates back to the batch by that id.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller handles merge queue messages. Implements consumer.Controller.

It loads the batch and its member requests, assembles the full merge request (one step per member request, in Contains order, each carrying that request's change and land strategy), and publishes it to runway's merge queue. Runway performs the merge out of process and returns the result on the merge-signal queue; the mergesignal stage consumes it and transitions the batch. This controller therefore performs no state transition itself.

func NewController

func NewController(
	logger *zap.SugaredLogger,
	scope tally.Scope,
	store storage.Storage,
	registry consumer.TopicRegistry,
	runwayTopicKey consumer.TopicKey,
	topicKey consumer.TopicKey,
	consumerGroup string,
) *Controller

NewController creates a new merge controller for the orchestrator. runwayTopicKey is the runway-owned topic this controller publishes merge requests to (TopicKeyMerge).

func (*Controller) ConsumerGroup

func (c *Controller) ConsumerGroup() string

ConsumerGroup returns the consumer group for offset tracking.

func (*Controller) Name

func (c *Controller) Name() string

Name returns the controller name for logging and metrics.

func (*Controller) Process

func (c *Controller) Process(ctx context.Context, delivery consumer.Delivery) error

Process publishes the full merge request to runway. Returns nil to ack (success), or error to nack/reject.

Error classification: deserialize and storage failures are non-retryable (reject to DLQ). The publish to runway is retryable — it is the hand-off that keeps the merge alive, so a transient enqueue blip should replay rather than strand the batch.

func (*Controller) TopicKey

func (c *Controller) TopicKey() consumer.TopicKey

TopicKey returns the topic key this controller subscribes to.

Jump to

Keyboard shortcuts

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