smsync

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAlwaysOpen

func NewAlwaysOpen(name string) smachine.SyncLink

func NewExclusive

func NewExclusive(name string) smachine.SyncLink

func NewExclusiveWithFlags

func NewExclusiveWithFlags(name string, flags DependencyQueueFlags) smachine.SyncLink

func NewFixedSemaphore

func NewFixedSemaphore(limit int, name string) smachine.SyncLink

Semaphore allows Acquire() call to pass through for a number of workers within the limit.

func NewFixedSemaphoreWithFlags

func NewFixedSemaphoreWithFlags(limit int, name string, flags DependencyQueueFlags) smachine.SyncLink

func NewInfiniteLock

func NewInfiniteLock(name string) smachine.SyncLink

Types

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

func NewConditionalBool

func NewConditionalBool(isOpen bool, name string) BoolConditionalLink

ConditionalBool allows Acquire() call to pass through when current value is true

func (BoolConditionalLink) IsZero

func (v BoolConditionalLink) IsZero() bool

func (BoolConditionalLink) NewToggle

Creates an adjustment that toggles the conditional when the adjustment is applied with SynchronizationContext.ApplyAdjustment() Can be applied multiple times.

func (BoolConditionalLink) NewValue

func (v BoolConditionalLink) NewValue(isOpen bool) smachine.SyncAdjustment

Creates an adjustment that sets the given value when applied with SynchronizationContext.ApplyAdjustment() Can be applied multiple times.

func (v BoolConditionalLink) SyncLink() smachine.SyncLink
type ConditionalLink struct {
	// contains filtered or unexported fields
}

func NewConditional

func NewConditional(initial int, name string) ConditionalLink

ConditionalBool allows Acquire() call to pass through when current value is >0

func (ConditionalLink) IsZero

func (v ConditionalLink) IsZero() bool

func (ConditionalLink) NewDelta

func (v ConditionalLink) NewDelta(delta int) smachine.SyncAdjustment

Creates an adjustment that alters the conditional's value when the adjustment is applied with SynchronizationContext.ApplyAdjustment() Can be applied multiple times.

func (ConditionalLink) NewValue

func (v ConditionalLink) NewValue(value int) smachine.SyncAdjustment

Creates an adjustment that sets the given value when applied with SynchronizationContext.ApplyAdjustment() Can be applied multiple times.

func (v ConditionalLink) SyncLink() smachine.SyncLink

type DependencyQueueFlags

type DependencyQueueFlags uint8
const (
	QueueAllowsPriority DependencyQueueFlags = 1 << iota
)
type SemaChildLink struct {
	// contains filtered or unexported fields
}

func (SemaChildLink) IsZero

func (v SemaChildLink) IsZero() bool

func (SemaChildLink) NewDelta

func (v SemaChildLink) NewDelta(delta int) smachine.SyncAdjustment

func (SemaChildLink) NewValue

func (v SemaChildLink) NewValue(value int) smachine.SyncAdjustment
func (v SemaChildLink) SyncLink() smachine.SyncLink

type SemaphoreChildFlags

type SemaphoreChildFlags uint8
const (
	AllowPartialRelease SemaphoreChildFlags = 1 << iota
	PrioritizePartialAcquire
)
type SemaphoreLink struct {
	// contains filtered or unexported fields
}

func NewSemaphore

func NewSemaphore(initialValue int, name string) SemaphoreLink

Semaphore allows Acquire() call to pass through for a number of workers within the limit. Negative and zero values are not passable. The limit can be changed with adjustments. Delta adjustments are capped by min/max int, no overflows.

func NewSemaphoreWithFlags

func NewSemaphoreWithFlags(initialValue int, name string, flags DependencyQueueFlags) SemaphoreLink

func (SemaphoreLink) IsZero

func (v SemaphoreLink) IsZero() bool

func (SemaphoreLink) NewChild

func (v SemaphoreLink) NewChild(childValue int, name string) SemaChildLink

func (SemaphoreLink) NewChildExt

func (v SemaphoreLink) NewChildExt(isAdjustable bool, childValue int, name string, flags SemaphoreChildFlags) SemaChildLink

func (SemaphoreLink) NewDelta

func (v SemaphoreLink) NewDelta(delta int) smachine.SyncAdjustment

func (SemaphoreLink) NewFixedChild

func (v SemaphoreLink) NewFixedChild(childValue int, name string) smachine.SyncLink

func (SemaphoreLink) NewValue

func (v SemaphoreLink) NewValue(value int) smachine.SyncAdjustment
func (v SemaphoreLink) PartialLink() smachine.SyncLink
func (v SemaphoreLink) SyncLink() smachine.SyncLink

Jump to

Keyboard shortcuts

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