wait

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TimeoutConfigDefault is the default timeout configuration.
	TimeoutConfigDefault = TimeoutConfig{
		ClusterMeshSyncTimeout:             1 * time.Minute,
		ClusterMeshIPIdentitiesSyncTimeout: 1 * time.Minute,
	}

	// ErrRemoteClusterDisconnected is the error returned by wait for sync
	// operations if the remote cluster is disconnected while still waiting.
	ErrRemoteClusterDisconnected = errors.New("remote cluster disconnected")
)

Functions

func ForAll added in v1.16.0

func ForAll(ctx context.Context, waiters []Fn) error

ForAll returns after the all of the provided waiters have been executed.

Types

type Fn added in v1.16.0

type Fn func(ctx context.Context) error

Fn is the type of a function to wait for the initial synchronization of a given resource type from all remote clusters.

type SyncedCommon added in v1.16.0

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

SyncedCommon contains common fields and methods used for tracking the synchronization status of a remote cluster.

func NewSyncedCommon added in v1.16.0

func NewSyncedCommon() SyncedCommon

NewSyncedCommon returns a new SyncedCommon instance.

func (*SyncedCommon) Stop added in v1.16.0

func (sc *SyncedCommon) Stop()

func (*SyncedCommon) Wait added in v1.16.0

func (sc *SyncedCommon) Wait(ctx context.Context, chs ...<-chan struct{}) error

Wait returns after all of the given channels have been closed, the remote cluster has been disconnected, or the given context has been cancelled.

type TimeoutConfig

type TimeoutConfig struct {
	// ClusterMeshSyncTimeout is the timeout when waiting for the initial
	// synchronization from all remote clusters, before triggering the
	// circuit breaker and possibly disrupting cross-cluster connections.
	ClusterMeshSyncTimeout time.Duration

	// ClusterMeshIPIdentitiesSyncTimeout is the timeout when waiting for the
	// initial synchronization of ipcache entries and identities from all remote
	// clusters before regenerating the local endpoints.
	// Deprecated in favor of ClusterMeshSyncTimeout.
	ClusterMeshIPIdentitiesSyncTimeout time.Duration
}

func (TimeoutConfig) Flags

func (def TimeoutConfig) Flags(flags *pflag.FlagSet)

func (TimeoutConfig) Timeout

func (tc TimeoutConfig) Timeout() time.Duration

Jump to

Keyboard shortcuts

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