v2

package
v0.54.3 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extensions added in v0.53.6

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

func (*Extensions) Add added in v0.53.6

func (e *Extensions) Add(ext SchedulerExtension)

func (*Extensions) Cleanup added in v0.53.6

func (e *Extensions) Cleanup() error

func (*Extensions) PostAssign added in v0.54.2

func (e *Extensions) PostAssign(tenantId string, input *PostAssignInput)

func (*Extensions) ReportSnapshot added in v0.54.2

func (e *Extensions) ReportSnapshot(tenantId string, input *SnapshotInput)

func (*Extensions) SetTenants added in v0.53.6

func (e *Extensions) SetTenants(tenants []*dbsqlc.Tenant)

type LeaseManager

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

LeaseManager is responsible for leases on multiple queues and multiplexing queue results to callers. It is still tenant-scoped.

type PostAssignInput added in v0.54.2

type PostAssignInput struct {
	HasUnassignedStepRuns bool
}

type QueueResults

type QueueResults struct {
	TenantId pgtype.UUID
	Assigned []*repository.AssignedItem

	// A list of step run ids that were not assigned because they reached the scheduling
	// timeout
	SchedulingTimedOut []string
}

type Queuer

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

func (*Queuer) Cleanup

func (q *Queuer) Cleanup()

type Scheduler

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

Scheduler is responsible for scheduling steps to workers as efficiently as possible. This is tenant-scoped, so each tenant will have its own scheduler.

type SchedulerExtension added in v0.53.6

type SchedulerExtension interface {
	SetTenants(tenants []*dbsqlc.Tenant)
	ReportSnapshot(tenantId string, input *SnapshotInput)
	PostAssign(tenantId string, input *PostAssignInput)
	Cleanup() error
}

type SchedulingPool

type SchedulingPool struct {
	Extensions *Extensions
	// contains filtered or unexported fields
}

SchedulingPool is responsible for managing a pool of tenantManagers.

func NewSchedulingPool

func NewSchedulingPool(repo repository.SchedulerRepository, l *zerolog.Logger, singleQueueLimit int) (*SchedulingPool, func() error, error)

func (*SchedulingPool) GetResultsCh

func (p *SchedulingPool) GetResultsCh() chan *QueueResults

func (*SchedulingPool) Queue

func (p *SchedulingPool) Queue(ctx context.Context, tenantId string, queueName string)

func (*SchedulingPool) RefreshAll

func (p *SchedulingPool) RefreshAll(ctx context.Context, tenantId string)

func (*SchedulingPool) Replenish

func (p *SchedulingPool) Replenish(ctx context.Context, tenantId string)

func (*SchedulingPool) SetTenants

func (p *SchedulingPool) SetTenants(tenants []*dbsqlc.Tenant)

type SlotCp added in v0.53.6

type SlotCp struct {
	WorkerId string
	Used     bool
}

type SlotUtilization added in v0.54.1

type SlotUtilization struct {
	UtilizedSlots    int
	NonUtilizedSlots int
}

type SnapshotInput added in v0.54.2

type SnapshotInput struct {
	Workers               map[string]*WorkerCp
	WorkerSlotUtilization map[string]*SlotUtilization
}

type WorkerCp added in v0.53.6

type WorkerCp struct {
	WorkerId string
	MaxRuns  int
	Labels   []*dbsqlc.ListManyWorkerLabelsRow
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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