Help us shape the future of Go! Take the 2026 Go Developer Survey

embedyield

package
v1.149.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package embedyield is the deployment-wide half of the embed gate (#1988): the embedding.Signal every replica publishes its interactive embeds to and every replica's index worker reads before it sends the embedding server background work, over the embed_interactive table (migration 000173).

A replica is one row, keyed by an id this process draws at startup, present while the replica has an interactive embed in flight. Rows are small and short-lived: a clear deletes the replica's row, and with it any row a stopped replica left past its hold.

Index

Constants

DefaultHold is how long a mark holds without being cleared: the request-path embed timeout, so a replica that stops mid-embed is waited on no longer than its embed could have lasted.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the embed_interactive table as an embedding.Signal.

func New

func New(db *sql.DB, hold time.Duration) *Store

New returns the signal for this process over db, marking for hold (DefaultHold when not positive). The process's id is random, so two replicas never share a row.

func (*Store) Busy

func (s *Store) Busy(ctx context.Context) (bool, error)

Busy reports whether any replica, this one included, has an interactive embed in flight.

func (*Store) Clear

func (s *Store) Clear(ctx context.Context) error

Clear says this replica has no interactive embed in flight, and removes any mark a stopped replica left past its hold.

func (*Store) Mark

func (s *Store) Mark(ctx context.Context) error

Mark says this replica has an interactive embed in flight until the hold runs out.

Jump to

Keyboard shortcuts

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