changeobservers

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package changeobservers is the list of callbacks an owner of replicated state runs after the state changes, so the extension host can push it to the runtimes that replicate it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Observers

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

Observers is a set of callbacks that run after a change to the state their owner holds. A registration replaces the list and never edits it, so Notify reads it without a lock and without allocating, from any goroutine and while the owner holds its own locks.

func (*Observers) Add

func (o *Observers) Add(observe func()) func()

Add registers observe and returns the function that removes it, which can be called repeatedly.

func (*Observers) Notify

func (o *Observers) Notify()

Notify runs the observers registered now, in registration order, on the caller's goroutine.

Jump to

Keyboard shortcuts

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