syncutil

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 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 ChannelTicker added in v0.6.0

type ChannelTicker struct {
	C chan time.Time
}

func (*ChannelTicker) Chan added in v0.6.0

func (t *ChannelTicker) Chan() <-chan time.Time

func (*ChannelTicker) Stop added in v0.6.0

func (t *ChannelTicker) Stop()

func (*ChannelTicker) Tick added in v0.6.0

func (t *ChannelTicker) Tick()

type GValue

type GValue[T any] struct {
	// contains filtered or unexported fields
}

func NewGValue

func NewGValue[T any](t T) *GValue[T]

func (*GValue[T]) CompareAndSwap

func (v *GValue[T]) CompareAndSwap(oldval T, newval T) bool

func (*GValue[T]) Init

func (v *GValue[T]) Init()

func (*GValue[T]) Load

func (v *GValue[T]) Load() T

func (*GValue[T]) Store

func (v *GValue[T]) Store(val T)

func (*GValue[T]) Swap

func (v *GValue[T]) Swap(newval T) T

type OnceDisposable

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

func NewOnceDisposable

func NewOnceDisposable() *OnceDisposable

func (*OnceDisposable) Dispose

func (o *OnceDisposable) Dispose(ctx context.Context, f func(ctx context.Context) error) error

func (*OnceDisposable) Do

func (o *OnceDisposable) Do(ctx context.Context, f func(ctx context.Context) error) error

type Ticker added in v0.6.0

type Ticker interface {
	Chan() <-chan time.Time
	Stop()
	Tick()
}

type TimeTicker added in v0.6.0

type TimeTicker struct {
	Ticker *time.Ticker
}

func (*TimeTicker) Chan added in v0.6.0

func (t *TimeTicker) Chan() <-chan time.Time

func (*TimeTicker) Stop added in v0.6.0

func (t *TimeTicker) Stop()

func (*TimeTicker) Tick added in v0.6.0

func (t *TimeTicker) Tick()

Jump to

Keyboard shortcuts

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