pool

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobNode

type JobNode struct {
	*v1.RegistryJob
}

JobNode is a node to be stored in jobMap and JobPool

func (*JobNode) DeepCopy

func (f *JobNode) DeepCopy() structs.Item

DeepCopy implements Item's method

func (*JobNode) Equals

func (f *JobNode) Equals(another structs.Item) bool

Equals implements Item's method

func (*JobNode) Priority

func (f *JobNode) Priority() int

Priority returns Item's priority

type JobPool

type JobPool struct {
	Pending *structs.SortedUniqueList
	Running *structs.SortedUniqueList
	// contains filtered or unexported fields
}

JobPool stores current status of v1.RegistryJobs, who are in Pending status or Running status All operations for this pool should be done in thread-safe manner, using Lock and Unlock methods

func NewJobPool

func NewJobPool(ch chan struct{}, compareFunc structs.CompareFunc) *JobPool

NewJobPool is a constructor for a JobPool

func (*JobPool) Lock

func (j *JobPool) Lock()

Lock locks JobPool

func (*JobPool) SyncJob

func (j *JobPool) SyncJob(job *v1.RegistryJob)

SyncJob syncs JobPool with an incoming IntegrationJob job, considering its status

func (*JobPool) Unlock

func (j *JobPool) Unlock()

Unlock unlocks JobPool

Jump to

Keyboard shortcuts

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