Documentation
¶
Overview ¶
Package stream is the client-facing read side of the plane. Snapshot returns a run's current state from the DataStore; Tail streams its facts live off the bus so a UI can render progress without polling. It declares no subscriptions and opens an ad-hoc subscription per tail.
Index ¶
- type Module
- func (m *Module) Mount(_ context.Context, d module.Deps) error
- func (m *Module) Name() string
- func (m *Module) Snapshot(ctx context.Context, tenant filament.TenantID, run filament.RunID) (filament.SyncSnapshot, error)
- func (m *Module) Subscriptions() []host.Subscription
- func (m *Module) Tail(ctx context.Context, tenant filament.TenantID, run filament.RunID) (<-chan events.Fact, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module is the client-facing read side.
func New ¶
func New() *Module
New returns an unmounted stream module. Providers are injected by Mount.
func (*Module) Snapshot ¶
func (m *Module) Snapshot(ctx context.Context, tenant filament.TenantID, run filament.RunID) (filament.SyncSnapshot, error)
Snapshot returns the run's current persisted state and resource states.
func (*Module) Subscriptions ¶
func (m *Module) Subscriptions() []host.Subscription
Subscriptions returns none; tails are opened per request, not at mount.
func (*Module) Tail ¶
func (m *Module) Tail(ctx context.Context, tenant filament.TenantID, run filament.RunID) (<-chan events.Fact, error)
Tail streams a run's facts live, returning a channel that closes when ctx is cancelled or the subscription drops. Each fact is acked on read, so a slow reader only backpressures the tail, never producers.