pipeline

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: AGPL-3.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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