Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WaitOrForget ¶
WaitOrForget waits for the given WaitGroup to be done or forgets about it after a given duration. Similar to the concept of "fire & forget", but waiting for some time before forgetting, and returning whether the `WaitGroup` is done or not within the duration time.
Types ¶
type WaitGroup ¶
type WaitGroup interface {
Wait()
}
WaitGroup defines the behavior of a `Wait`-able object.
type WaitGroupWithCount ¶
type WaitGroupWithCount struct {
// contains filtered or unexported fields
}
WaitGroupWithCount defines the behavior of a WaitGroup with a count.
func NewWaitGroupWithCount ¶
func NewWaitGroupWithCount() *WaitGroupWithCount
NewWaitGroupWithCount constructs a new instance of WaitGroupWithCount.
func (*WaitGroupWithCount) Add ¶
func (w *WaitGroupWithCount) Add(delta int)
Add adds the given delta to the count of the WaitGroupWithCount. Equivalent to sync.WaitGroup.Add, but for WaitGroupWithCount.
func (*WaitGroupWithCount) Count ¶
func (w *WaitGroupWithCount) Count() int
Count returns the count of WaitGroupWithCount.
func (*WaitGroupWithCount) Done ¶
func (w *WaitGroupWithCount) Done()
Done decrements the count of the WaitGroupWithCount. Equivalent to sync.WaitGroup.Done, but for WaitGroupWithCount.
func (*WaitGroupWithCount) Wait ¶
func (w *WaitGroupWithCount) Wait()
Wait blocks until the count of the WaitGroupWithCount is zero. Equivalent to sync.WaitGroup.Wait, but for WaitGroupWithCount.