hub

package
v0.0.53 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package hub exposes sup actors, controls, signals, and events over HTTP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hub

type Hub struct {
	*sup.BaseActor
	// contains filtered or unexported fields
}

Hub exposes actors, controls, signals, and events over HTTP.

func New added in v0.0.52

func New(id string, options ...Option) *Hub

New creates a hub with the given id and options.

func (*Hub) Handler added in v0.0.52

func (h *Hub) Handler() http.Handler

Handler returns the HTTP handler for the hub API and debug UI.

func (*Hub) Inspect added in v0.0.52

func (h *Hub) Inspect() sup.Spec

Inspect returns the hub spec.

func (*Hub) Observer added in v0.0.52

func (h *Hub) Observer() *sup.SupervisorObserver

Observer returns a supervisor observer that records actor lifecycle events.

func (*Hub) RegisterActor added in v0.0.52

func (h *Hub) RegisterActor(actor sup.Actor)

RegisterActor registers an actor with the hub.

func (*Hub) Run added in v0.0.52

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

Run starts registered signal streams until they stop, fail, or the context is canceled.

type Option added in v0.0.52

type Option func(*Hub)

Option configures a Hub.

func WithActor added in v0.0.52

func WithActor(actor sup.Actor) Option

WithActor registers an actor with the hub.

func WithEventLimit added in v0.0.52

func WithEventLimit(limit int) Option

WithEventLimit sets the maximum number of events stored per source.

func WithSignal added in v0.0.52

func WithSignal[V any](signal sup.ReadableSignal[V]) Option

WithSignal registers a readable signal with the hub.

Jump to

Keyboard shortcuts

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