embedyield

package
v1.170.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 6 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 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); and the embedding.BackgroundSignal every replica's index worker publishes the background input it has at the server to and every replica's search reads before it bounds its embed, over the embed_background table (migration 000274, #2846).

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) BackgroundInput added in v1.169.5

func (s *Store) BackgroundInput(ctx context.Context) (time.Duration, error)

BackgroundInput is how long the embedding server needs to finish the background inputs every replica has at it now: the sum of the live marks, since the server serves them one after another.

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) ClearBackground added in v1.169.5

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

ClearBackground says this replica has no background call at the server, 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.

func (*Store) MarkBackground added in v1.169.5

func (s *Store) MarkBackground(ctx context.Context, input time.Duration) error

MarkBackground says this replica has a background call at the embedding server whose largest input is expected to take input, until embedding.DefaultBackgroundHold runs out.

Jump to

Keyboard shortcuts

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