register

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WriteOnce

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

WriteOnce 保证对应的val只会被写入一次,读取值时若未被写入,则等待直至值被其他goroutine写入

func (*WriteOnce[T]) Read

func (w *WriteOnce[T]) Read() T

func (*WriteOnce[T]) TryWrite

func (w *WriteOnce[T]) TryWrite(val T) bool

func (*WriteOnce[T]) Write

func (w *WriteOnce[T]) Write(val T)

Jump to

Keyboard shortcuts

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