sync

package
v2.11.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockAction

type LockAction string
const (
	LockActionAcquired LockAction = "acquired"
	LockActionReleased LockAction = "released"
	LockActionWaiting  LockAction = "waiting"
)

type LockName

type LockName struct {
	Namespace    string
	Kind         string
	ResourceName string
	Key          string
	Type         LockType
}

func DecodeLockName

func DecodeLockName(lockName string) (*LockName, error)

func NewLockName

func NewLockName(namespace, kind, resourceName, lockKey string) *LockName

type LockType

type LockType string
const (
	LockTypeSemaphore LockType = "semaphore"
	LockTypeMutex     LockType = "mutex"
)

type Mutex

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

func NewMutex

func NewMutex(name string, callbackFunc func(string)) *Mutex

NewMutex creates new mutex lock object name of the mutex callbackFunc is a release notification function.

type ReleaseNotifyCallbackFunc

type ReleaseNotifyCallbackFunc func(string)

type Semaphore

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

func NewSemaphore

func NewSemaphore(name string, limit int, callbackFunc func(string), lockType LockType) *Semaphore

type SyncLimitConfigFunc

type SyncLimitConfigFunc func(string) (int, error)

type SyncManager

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

func NewLockManager

func NewLockManager(getSyncLimitConfigFunc func(string) (int, error), callbackFunc func(string)) *SyncManager

func (*SyncManager) Initialize

func (cm *SyncManager) Initialize(wfList *wfv1.WorkflowList)

func (*SyncManager) Release

func (cm *SyncManager) Release(wf *wfv1.Workflow, nodeName, namespace string, syncRef *wfv1.Synchronization)

func (*SyncManager) ReleaseAll

func (cm *SyncManager) ReleaseAll(wf *wfv1.Workflow) bool

func (*SyncManager) TryAcquire

func (cm *SyncManager) TryAcquire(wf *wfv1.Workflow, nodeName string, priority int32, creationTime time.Time, syncLockRef *wfv1.Synchronization) (bool, bool, string, error)

TryAcquire tries to acquire the lock from semaphore. It returns status of acquiring a lock , status of Workflow status updated, waiting message if lock is not available and any error encountered

type Synchronization

type Synchronization interface {
	// contains filtered or unexported methods
}

type Throttler

type Throttler interface {
	Add(key interface{}, priority int32, creationTime time.Time)
	// Next returns true if item should be processed by controller now or return false.
	Next(key interface{}) (interface{}, bool)
	// Remove notifies throttler that item processing is done. In responses the throttler triggers processing of previously throttled items.
	Remove(key interface{})
	// SetParallelism update throttler parallelism limit.
	SetParallelism(parallelism int)
}

Throttler allows CRD controller to limit number of items it is processing in parallel.

func NewThrottler

func NewThrottler(parallelism int, queue workqueue.RateLimitingInterface) Throttler

Jump to

Keyboard shortcuts

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