scheduler

package
v0.0.0-...-9e054ec Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package scheduler contains Sequencer-specific utilities for ensuring ordered access to rows.

Index

Constants

This section is empty.

Variables

Set is used by Wire.

Functions

This section is empty.

Types

type Scheduler

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

A Scheduler is shared across Sequencer implementations to limit overall parallelism and to ensure ordered access to target rows.

func ProvideScheduler

func ProvideScheduler(ctx context.Context, cfg *sequencer.Config) (*Scheduler, error)

ProvideScheduler is called by Wire.

func (*Scheduler) Batch

func (s *Scheduler) Batch(batch *types.MultiBatch, fn func() error) *notify.Var[*lockset.Status]

Batch executes the callback when it has clear access to apply all mutations in the given batch.

func (*Scheduler) Singleton

func (s *Scheduler) Singleton(
	table ident.Table, mut types.Mutation, fn func() error,
) *notify.Var[*lockset.Status]

Singleton executes the callback executed when it has clear access to apply the mutation in the given table.

func (*Scheduler) TableBatch

func (s *Scheduler) TableBatch(
	batch *types.TableBatch, fn func() error,
) *notify.Var[*lockset.Status]

TableBatch executes the callback executed when it has clear access to apply the mutation in the given batch.

func (*Scheduler) TemporalBatch

func (s *Scheduler) TemporalBatch(
	batch *types.TemporalBatch, fn func() error,
) *notify.Var[*lockset.Status]

TemporalBatch executes the callback executed when it has clear access to apply the mutations in the given batch.

Jump to

Keyboard shortcuts

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