sync

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConflictingLifecycleActionError

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

func (*ConflictingLifecycleActionError) Error

type IntentionLock

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

IntentionLock is a non-blocking multi-granular lock whose acquisition semantics respect the following matrix:

IX  X

IX | Y | N

X | N | N

func (*IntentionLock) TryLock

func (l *IntentionLock) TryLock(granularity LockGranularity) (*IntentionLockUnlocker, bool)

TryLock will attempt to lock the IntentionLock with the supplied LockGranularity without blocking. If it succeeds it returns an IntentionLockUnlocker which must later be used to unlock the lock. If it fails it returns nil.

type IntentionLockUnlocker

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

IntentionLockUnlocker is returned by a successful call to TryLock, and is used to later unlock the IntentionLock with the proper granularity.

func (*IntentionLockUnlocker) Granularity

func (u *IntentionLockUnlocker) Granularity() LockGranularity

func (*IntentionLockUnlocker) Unlock

func (u *IntentionLockUnlocker) Unlock()

Unlock will unlock the corresponding IntentionLock for the granularity associated with the IntentionLockUnlocker.

type LifecycleActionManager

type LifecycleActionManager struct {
	// this could be a RWMutex but trying to keep things "simple" to start
	sync.Mutex
	// contains filtered or unexported fields
}

func NewLifecycleActionManager

func NewLifecycleActionManager() *LifecycleActionManager

func (*LifecycleActionManager) AcquireDeploy

func (a *LifecycleActionManager) AcquireDeploy(system v1.SystemID, deploy v1.DeployID, path tree.Path) error

func (*LifecycleActionManager) AcquireTeardown

func (a *LifecycleActionManager) AcquireTeardown(system v1.SystemID, teardown v1.TeardownID) error

func (*LifecycleActionManager) InProgressActions

func (a *LifecycleActionManager) InProgressActions(system v1.SystemID) ([]v1.DeployID, *v1.TeardownID)

func (*LifecycleActionManager) ReleaseDeploy

func (a *LifecycleActionManager) ReleaseDeploy(system v1.SystemID, deploy v1.DeployID)

func (*LifecycleActionManager) ReleaseTeardown

func (a *LifecycleActionManager) ReleaseTeardown(system v1.SystemID, teardown v1.TeardownID)

type LockGranularity

type LockGranularity int32

LockGranularity defines the granularity with which to obtain a lock.

const (
	// LockGranularityIntentionExclusive can be acquired if no
	// other goroutine has acquired the lock with LockGranularityExclusive.
	LockGranularityIntentionExclusive LockGranularity = iota

	// LockGranularityExclusive can be acquired if no other goroutine
	// has acquired the lock with LockGranularityExclusive or LockGranularityIntentionExclusive.
	LockGranularityExclusive
)

Jump to

Keyboard shortcuts

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