Documentation
¶
Index ¶
- type ConcurrencyManager
- type ConcurrencyResults
- type Extensions
- type LeaseManager
- type PostAssignInput
- type QueueResults
- type Queuer
- type Scheduler
- type SchedulerExtension
- type SchedulingPool
- func (p *SchedulingPool) GetConcurrencyResultsCh() chan *ConcurrencyResults
- func (p *SchedulingPool) GetResultsCh() chan *QueueResults
- func (p *SchedulingPool) NotifyConcurrency(ctx context.Context, tenantId string, strategyIds []int64)
- func (p *SchedulingPool) NotifyQueues(ctx context.Context, tenantId string, queueNames []string)
- func (p *SchedulingPool) Replenish(ctx context.Context, tenantId string)
- func (p *SchedulingPool) SetTenants(tenants []*dbsqlc.Tenant)
- type SlotCp
- type SlotUtilization
- type SnapshotInput
- type WorkerCp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcurrencyManager ¶
type ConcurrencyManager struct {
// contains filtered or unexported fields
}
func (*ConcurrencyManager) Cleanup ¶
func (c *ConcurrencyManager) Cleanup()
type ConcurrencyResults ¶
type ConcurrencyResults struct {
*v1.RunConcurrencyResult
TenantId pgtype.UUID
}
type Extensions ¶
type Extensions struct {
// contains filtered or unexported fields
}
func (*Extensions) Add ¶
func (e *Extensions) Add(ext SchedulerExtension)
func (*Extensions) Cleanup ¶
func (e *Extensions) Cleanup() error
func (*Extensions) PostAssign ¶
func (e *Extensions) PostAssign(tenantId string, input *PostAssignInput)
func (*Extensions) ReportSnapshot ¶
func (e *Extensions) ReportSnapshot(tenantId string, input *SnapshotInput)
func (*Extensions) SetTenants ¶
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 ¶
type PostAssignInput struct {
HasUnassignedStepRuns bool
}
type QueueResults ¶
type QueueResults struct {
TenantId pgtype.UUID
Assigned []*v1.AssignedItem
Unassigned []*sqlcv1.V1QueueItem
SchedulingTimedOut []*sqlcv1.V1QueueItem
RateLimited []*v1.RateLimitResult
}
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 ¶
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 v1.SchedulerRepository, l *zerolog.Logger, singleQueueLimit int) (*SchedulingPool, func() error, error)
func (*SchedulingPool) GetConcurrencyResultsCh ¶
func (p *SchedulingPool) GetConcurrencyResultsCh() chan *ConcurrencyResults
func (*SchedulingPool) GetResultsCh ¶
func (p *SchedulingPool) GetResultsCh() chan *QueueResults
func (*SchedulingPool) NotifyConcurrency ¶
func (p *SchedulingPool) NotifyConcurrency(ctx context.Context, tenantId string, strategyIds []int64)
func (*SchedulingPool) NotifyQueues ¶
func (p *SchedulingPool) NotifyQueues(ctx context.Context, tenantId string, queueNames []string)
func (*SchedulingPool) Replenish ¶
func (p *SchedulingPool) Replenish(ctx context.Context, tenantId string)
func (*SchedulingPool) SetTenants ¶
func (p *SchedulingPool) SetTenants(tenants []*dbsqlc.Tenant)
type SlotUtilization ¶
type SnapshotInput ¶
type SnapshotInput struct {
Workers map[string]*WorkerCp
WorkerSlotUtilization map[string]*SlotUtilization
}
Click to show internal directories.
Click to hide internal directories.