live

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 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

Overview

Package live tells dashboards when to refresh. Whatever changes a workspace's queues, tasks, schedules or runs (an API call, a delivery) calls Hub.Changed; the hub coalesces those into change notices for every replica through the store, and each replica passes them on to the event streams (GET /v1/events) it serves for that workspace.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hub

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

func New

func New(s store.Changes, log *slog.Logger) *Hub

func (*Hub) Changed

func (h *Hub) Changed(ws workspace.ID)

Changed records that the workspace changed. It doesn't block.

func (*Hub) Run

func (h *Hub) Run(ctx context.Context)

Run publishes and listens for notices until ctx is done.

func (*Hub) Stopped

func (h *Hub) Stopped() <-chan struct{}

Stopped is closed when Run returns, so streams can end before the server shuts down rather than hold it up.

func (*Hub) Subscribe

func (h *Hub) Subscribe(ws workspace.ID) (c <-chan struct{}, cancel func())

Subscribe returns a channel that receives a value after the workspace changes. Values coalesce: one may stand for several changes. Call cancel when done.

Jump to

Keyboard shortcuts

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