promise

package
v0.29.9 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCountingWriteOnce

func NewCountingWriteOnce(activeCounter counter.GoRoutineCounter, lock sync.Locker, initial interface{}, doneCh <-chan struct{}, doneVal interface{}) promiseifc.WriteOnce

NewCountingWriteOnce creates a WriteOnce that uses locking and counts goroutine activity.

The final three arguments are like those for a regular WriteOnce factory: - an optional initial value, - an optional "done" channel, - the value that is Set after the "done" channel becomes selectable. Note that for this implementation, the reaction to `doneCh` becoming selectable does not wait for a Get. If `doneCh != nil` then the caller promises to close it reasonably promptly (to the degree allowed by the Go runtime scheduler), and increment the goroutine counter before that. The WriteOnce's Get method must be called without the lock held. The WriteOnce's Set method must be called with the lock held.

Types

This section is empty.

Jump to

Keyboard shortcuts

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