pipeline

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionKind

type ActionKind string
const (
	ActionEmit            ActionKind = "emit"
	ActionAccept          ActionKind = "accept"
	ActionDispatch        ActionKind = "dispatch"
	ActionDedupRoute      ActionKind = "dedup route"
	ActionCapabilityStart ActionKind = "capability start"
	ActionCapabilityDone  ActionKind = "capability done"
)

type Capability

type Capability struct {
	Name   string
	Routes []Route
	Worker int
	RunKey func(Event) string
	Run    func(ctx context.Context, event Event, emit func(Event))
}

func (Capability) KeyFor

func (c Capability) KeyFor(e Event) string

type Config

type Config struct {
	Capabilities []Capability
	Bus          *eventbus.Bus[Observation]
}

type Event

type Event interface {
	Key() string
}

type Observation

type Observation struct {
	Action     ActionKind
	Capability string
	Event      Event
}

type Pipeline

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

func New

func New(ctx context.Context, cfg Config) (*Pipeline, error)

func (*Pipeline) RouteStats

func (p *Pipeline) RouteStats() map[string]int

RouteStats returns per-route dedup map sizes. Keyed by "from->cap". A value of -1 means the map has been freed. For testing only.

func (*Pipeline) Run

func (p *Pipeline) Run(seeds []Event)

func (*Pipeline) Submit

func (p *Pipeline) Submit(e Event)

type Route

type Route struct {
	From   string
	Accept func(Event) bool
}

Jump to

Keyboard shortcuts

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