atomic

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Value

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

Value is an atomic of absract value

func (*Value[T]) Clear

func (c *Value[T]) Clear(cleaner func(T))

Clear it cleans value if it exists

func (*Value[T]) Fetch

func (c *Value[T]) Fetch(sink func(T)) bool

Fetch call sink if value is present

func (*Value[T]) Load

func (c *Value[T]) Load() (v T, ok bool)

Load -

func (*Value[T]) Store

func (c *Value[T]) Store(v T, cleaner func(T))

Store -

Jump to

Keyboard shortcuts

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