xsync

package
v3.66.3 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLastUsage added in v3.65.0

func NewLastUsage(opts ...lastUsageOption) *lastUsage

func OnceFunc added in v3.58.0

func OnceFunc(f func(ctx context.Context) error) func(ctx context.Context) error

func WithClock added in v3.65.0

func WithClock(clock clockwork.Clock) lastUsageOption

Types

type EventBroadcast added in v3.38.0

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

EventBroadcast is implementation of broadcast notify about event Zero value is usable, must not copy after first call any method

func (*EventBroadcast) Broadcast added in v3.38.0

func (b *EventBroadcast) Broadcast()

func (*EventBroadcast) Waiter added in v3.38.0

func (b *EventBroadcast) Waiter() OneTimeWaiter

Waiter return channel, that will close when next event will be broadcast. For prevent race between subscribe and event client code must subscribe at first, then check condition if false - wait closing channed and check condition again

type LastUsage added in v3.65.0

type LastUsage interface {
	Get() time.Time
	Start() (stop func())
}

type Mutex

type Mutex struct {
	sync.Mutex
}

func (*Mutex) WithLock

func (l *Mutex) WithLock(f func())

type Once added in v3.59.0

type Once[T closer.Closer] struct {
	// contains filtered or unexported fields
}

func OnceValue added in v3.58.0

func OnceValue[T closer.Closer](f func() T) *Once[T]

func (*Once[T]) Close added in v3.59.0

func (v *Once[T]) Close(ctx context.Context) (err error)

func (*Once[T]) Get added in v3.59.0

func (v *Once[T]) Get() T

type OneTimeWaiter added in v3.38.0

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

func (*OneTimeWaiter) Done added in v3.38.0

func (w *OneTimeWaiter) Done() <-chan struct{}

type RWMutex

type RWMutex struct {
	sync.RWMutex
}

func (*RWMutex) WithLock

func (l *RWMutex) WithLock(f func())

func (*RWMutex) WithRLock

func (l *RWMutex) WithRLock(f func())

Jump to

Keyboard shortcuts

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