state

package
v0.100.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 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 PSConstants added in v0.94.0

type PSConstants struct {
	RetryInterval time.Duration
	RetryGap      time.Duration
	MaxRetries    int
}

type PipelineSelector

type PipelineSelector struct {
	RS *RetryState
	// contains filtered or unexported fields
}

PipelineSelector is meant to serve as the source of truth for the target priority level

func NewPipelineSelector

func NewPipelineSelector(lenPriority int, consts PSConstants) *PipelineSelector

func (*PipelineSelector) ChannelIndex added in v0.94.0

func (p *PipelineSelector) ChannelIndex(ch chan bool) int

For Testing

func (*PipelineSelector) ListenToChannels added in v0.94.0

func (p *PipelineSelector) ListenToChannels(done chan struct{}, wg *sync.WaitGroup)

func (*PipelineSelector) ResetRetryCount added in v0.96.0

func (p *PipelineSelector) ResetRetryCount(idx int)

func (*PipelineSelector) SelectedPipeline added in v0.94.0

func (p *PipelineSelector) SelectedPipeline() (int, chan bool)

func (*PipelineSelector) SetRetryCountToMax added in v0.96.0

func (p *PipelineSelector) SetRetryCountToMax(idx int)

func (*PipelineSelector) Start added in v0.94.0

func (p *PipelineSelector) Start(done chan struct{}, wg *sync.WaitGroup)

func (*PipelineSelector) TestCurrentIndex added in v0.99.0

func (p *PipelineSelector) TestCurrentIndex() int

func (*PipelineSelector) TestRetryPipelines added in v0.99.0

func (p *PipelineSelector) TestRetryPipelines(ctx context.Context, retryInterval time.Duration, retryGap time.Duration)

func (*PipelineSelector) TestSetStableIndex added in v0.96.0

func (p *PipelineSelector) TestSetStableIndex(idx int32)

func (*PipelineSelector) TestStableIndex added in v0.96.0

func (p *PipelineSelector) TestStableIndex() int

type RetryState

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

Manages cancel function for retry goroutine, ends up cleaner than using channels

func (*RetryState) InvokeCancel

func (m *RetryState) InvokeCancel()

func (*RetryState) UpdateCancelFunc

func (m *RetryState) UpdateCancelFunc(newCancelFunc context.CancelFunc)

type TryLock

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

func NewTryLock

func NewTryLock() *TryLock

func (*TryLock) TryExecute

func (t *TryLock) TryExecute(fn func(int), arg int)

Jump to

Keyboard shortcuts

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