stream

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus interface {
	Publish(ctx context.Context, execID uuid.UUID, d Delta) error
	Start(ctx context.Context, deliver func(execID uuid.UUID, d Delta)) error
}

type Delta

type Delta struct {
	StepID string `json:"step_id"`
	Seq    int64  `json:"seq"`
	Data   string `json:"data"`
}

type Hub

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

func NewHub

func NewHub(bus Bus) *Hub

func (*Hub) Publish

func (h *Hub) Publish(ctx context.Context, execID uuid.UUID, d Delta) error

func (*Hub) Start

func (h *Hub) Start(ctx context.Context) error

func (*Hub) Subscribe

func (h *Hub) Subscribe(execID uuid.UUID) (<-chan Delta, func())

type MemoryBus

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

func NewMemoryBus

func NewMemoryBus() *MemoryBus

func (*MemoryBus) Publish

func (b *MemoryBus) Publish(ctx context.Context, execID uuid.UUID, d Delta) error

func (*MemoryBus) Start

func (b *MemoryBus) Start(ctx context.Context, deliver func(uuid.UUID, Delta)) error

type PostgresBus

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

func NewPostgresBus

func NewPostgresBus(pool *pgxpool.Pool, log *slog.Logger) *PostgresBus

func (*PostgresBus) Publish

func (b *PostgresBus) Publish(ctx context.Context, execID uuid.UUID, d Delta) error

func (*PostgresBus) Start

func (b *PostgresBus) Start(ctx context.Context, deliver func(execID uuid.UUID, d Delta)) error

Jump to

Keyboard shortcuts

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