Documentation ¶
Overview ¶
Package flux provides concurrently accessible scalar value types which can be updated incrementally. A single observer goroutine can receive change notifications via a channel. There can be one or more mutator goroutines.
Mutator goroutines can call the Increment, Poke, Finish and Value methods. The consumer goroutine can call the Chan and Value methods.
There isn't a one-to-one correspondence between updates and notifications: multiple Increment calls may be coalesced to a single successful channel reception. It's also possible that the same value is observed after receiving a notification. The value may wrap around; it's the application's responsibility to take that into account.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Uint32 ¶
type Uint32 struct { Waker // contains filtered or unexported fields }
Uint32 value in flux.
func MakeUint32 ¶
MakeUint32 is for initializing a field. Multiple copies of the struct value must not be used.
type Uint64 ¶
type Uint64 struct { Waker // contains filtered or unexported fields }
Uint64 value in flux.
func MakeUint64 ¶
MakeUint64 is for initializing a field. Multiple copies of the struct value must not be used.
type Waker ¶
type Waker struct {
// contains filtered or unexported fields
}
Waker coalesces notifications.
func (Waker) Chan ¶
func (w Waker) Chan() <-chan struct{}
Chan is unblocked when it's time to wake up. It is closed at Finish.