events

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 1 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 events is the daemon's in-process event bus: governor state changes, model download progress, and model lifecycle changes fan out to SSE subscribers (web dash, desktop app, TUI). Publishing never blocks — a slow consumer misses intermediate events and converges on the next status snapshot.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type string
	Data any
}

Event is one published occurrence. Data must be JSON-marshalable.

type Hub

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

Hub fans events out to subscribers.

func NewHub

func NewHub() *Hub

NewHub builds an empty hub.

func (*Hub) Publish

func (h *Hub) Publish(typ string, data any)

Publish delivers to every subscriber, dropping when a buffer is full. Safe on a nil hub (publishers don't care whether anyone wired events).

func (*Hub) Subscribe

func (h *Hub) Subscribe() (<-chan Event, func())

Subscribe registers a consumer; call the returned func to detach.

Jump to

Keyboard shortcuts

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