queue

package
v4.72.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWorkerCount = 1000

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentRandomQueue

type ConcurrentRandomQueue[T any] struct {
	// contains filtered or unexported fields
}

ConcurrentRandomQueue is a generic, thread-safe queue that pops random elements in O(1) time.

func NewConcurrentRandomQueue

func NewConcurrentRandomQueue[T any](seed int64, capacityHint int) *ConcurrentRandomQueue[T]

func (*ConcurrentRandomQueue[T]) Pop

func (q *ConcurrentRandomQueue[T]) Pop() *T

func (*ConcurrentRandomQueue[T]) Push

func (q *ConcurrentRandomQueue[T]) Push(item T)

type Option

type Option func(*Scheduler)

func WithCaser

func WithCaser(c *caser.Caser) Option

func WithDeterministicCQID

func WithDeterministicCQID(deterministicCQID bool) Option

func WithInvocationID

func WithInvocationID(invocationID string) Option

func WithWorkerCount

func WithWorkerCount(workerCount int) Option

type Scheduler

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

func NewShuffleQueueScheduler

func NewShuffleQueueScheduler(logger zerolog.Logger, m *metrics.Metrics, seed int64, opts ...Option) *Scheduler

func (*Scheduler) Sync

func (d *Scheduler) Sync(ctx context.Context, tableClients []WorkUnit, resolvedResources chan<- *schema.Resource)

type WorkUnit

type WorkUnit struct {
	Table  *schema.Table
	Client schema.ClientMeta
	Parent *schema.Resource
}

WorkUnit is an atomic unit of work that the scheduler syncs.

It is one table resolver (same as all other scheduler strategies).

But if it is a non-top-level table, it is bound to a single parent resource.

Jump to

Keyboard shortcuts

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