messaging

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	// Consume consumes an event from the queue.
	Consume(ctx context.Context, envelope *Envelope) error
}

type Envelope

type Envelope struct {
	// ResourceID the GUID of a resource.
	ResourceID string
	// DeletionTimestamp describes whether the resource is being deleted
	// or not, and is used for routing.  If not set this is a creation or
	// update event.
	DeletionTimestamp *time.Time
}

Envelope is a generic messaging envelope for resource messages.

type Queue

type Queue interface {
	// Run starts the event queue consumption.  This is a blocking call.
	Run(ctx context.Context, consumers ...Consumer) error
}

Queue is an abstract message queue client, the exact implementation is defined by the implementation. A queue must always replay all active resources, so we can witness missed events on a restart. If an error is encontered when the consumer is invoked, then the event must be requeued to mitigate transient errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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