Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataNotifier ¶
type DataNotifier[T any] struct { // contains filtered or unexported fields }
func NewDataNotifier ¶
func NewDataNotifier[T any]() *DataNotifier[T]
func (*DataNotifier[T]) Notify ¶
func (dn *DataNotifier[T]) Notify(d T)
func (*DataNotifier[T]) Wait ¶
func (dn *DataNotifier[T]) Wait() *LazyData[T]
type LazyData ¶
type LazyData[T any] struct { // contains filtered or unexported fields }
func NewLazyData ¶
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
func NewNotifier ¶
func NewNotifier() *Notifier
type SafeClose ¶
type SafeClose struct {
// contains filtered or unexported fields
}
func NewSafeClose ¶
func NewSafeClose() *SafeClose
func (*SafeClose) Attach ¶
func (s *SafeClose) Attach(f func(done func(), closeSignal <-chan struct{}))
Attach add this goroutine to s.wg CloseWait. f must receive closeSignal and call done when it is done. If s was closed, f will not run.
func (*SafeClose) CloseWait ¶
func (s *SafeClose) CloseWait()
CloseWait sends a close signal to SafeClose and wait until it is closed. It is concurrent safe and can be called multiple times. CloseWait blocks until s.Done() is called and all Attach-ed goroutines is done.
func (*SafeClose) Done ¶
func (s *SafeClose) Done()
Done notifies CloseWait that is done. It is concurrent safe and can be called multiple times.
func (*SafeClose) ReceiveCloseSignal ¶
func (s *SafeClose) ReceiveCloseSignal() <-chan struct{}
func (*SafeClose) SendCloseSignal ¶
SendCloseSignal sends a close signal.
Click to show internal directories.
Click to hide internal directories.