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
- type Store
- func (s *Store) BackgroundInput(ctx context.Context) (time.Duration, error)
- func (s *Store) Busy(ctx context.Context) (bool, error)
- func (s *Store) Clear(ctx context.Context) error
- func (s *Store) ClearBackground(ctx context.Context) error
- func (s *Store) Mark(ctx context.Context) error
- func (s *Store) MarkBackground(ctx context.Context, input time.Duration) error
Constants ¶
const DefaultHold = embedding.DefaultTimeout * time.Second
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 ¶
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
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 ¶
Busy reports whether any replica, this one included, has an interactive embed in flight.
func (*Store) Clear ¶
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
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 ¶
Mark says this replica has an interactive embed in flight until the hold runs out.
func (*Store) MarkBackground ¶ added in v1.169.5
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.