Documentation ¶
Index ¶
- func NewAlwaysOpen(name string) smachine.SyncLink
- func NewExclusive(name string) smachine.SyncLink
- func NewExclusiveWithFlags(name string, flags DependencyQueueFlags) smachine.SyncLink
- func NewFixedSemaphore(limit int, name string) smachine.SyncLink
- func NewFixedSemaphoreWithFlags(limit int, name string, flags DependencyQueueFlags) smachine.SyncLink
- func NewInfiniteLock(name string) smachine.SyncLink
- type BoolConditionalLink
- type ConditionalLink
- type DependencyQueueFlags
- type SemaChildLink
- type SemaphoreChildFlags
- type SemaphoreLink
- func (v SemaphoreLink) IsZero() bool
- func (v SemaphoreLink) NewChild(childValue int, name string) SemaChildLink
- func (v SemaphoreLink) NewChildExt(isAdjustable bool, childValue int, name string, flags SemaphoreChildFlags) SemaChildLink
- func (v SemaphoreLink) NewDelta(delta int) smachine.SyncAdjustment
- func (v SemaphoreLink) NewFixedChild(childValue int, name string) smachine.SyncLink
- func (v SemaphoreLink) NewValue(value int) smachine.SyncAdjustment
- func (v SemaphoreLink) PartialLink() smachine.SyncLink
- func (v SemaphoreLink) SyncLink() smachine.SyncLink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAlwaysOpen ¶
func NewExclusive ¶
func NewExclusiveWithFlags ¶
func NewExclusiveWithFlags(name string, flags DependencyQueueFlags) smachine.SyncLink
func NewFixedSemaphore ¶
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 ¶
Types ¶
type BoolConditionalLink ¶
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 ¶
func (v BoolConditionalLink) NewToggle() smachine.SyncAdjustment
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 (BoolConditionalLink) SyncLink ¶
func (v BoolConditionalLink) SyncLink() smachine.SyncLink
type ConditionalLink ¶
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 (ConditionalLink) SyncLink ¶
func (v ConditionalLink) SyncLink() smachine.SyncLink
type DependencyQueueFlags ¶
type DependencyQueueFlags uint8
const (
QueueAllowsPriority DependencyQueueFlags = 1 << iota
)
type SemaChildLink ¶
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 (SemaChildLink) SyncLink ¶
func (v SemaChildLink) SyncLink() smachine.SyncLink
type SemaphoreChildFlags ¶
type SemaphoreChildFlags uint8
const ( AllowPartialRelease SemaphoreChildFlags = 1 << iota PrioritizePartialAcquire )
type SemaphoreLink ¶
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 (SemaphoreLink) PartialLink ¶
func (v SemaphoreLink) PartialLink() smachine.SyncLink
func (SemaphoreLink) SyncLink ¶
func (v SemaphoreLink) SyncLink() smachine.SyncLink