Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Signaler ¶
type Signaler struct { C chan struct{} // contains filtered or unexported fields }
Signaler allows for multiple writers to safely signal an event so that reader on the channel C would get unblocked
type WaitingCounter ¶ added in v1.17.0
A WaitingCounter waits for a counter to go to zero.
func (*WaitingCounter) Add ¶ added in v1.17.0
func (r *WaitingCounter) Add(c int32)
Add increments the counter. As opposed to sync.WaitGroup, it is safe to be called after Wait has been called.
func (*WaitingCounter) Done ¶ added in v1.17.0
func (r *WaitingCounter) Done()
Done decrements the counter. If the counter goes bellow zero a panic will be raised.
func (*WaitingCounter) Wait ¶ added in v1.17.0
func (r *WaitingCounter) Wait(waitFor time.Duration) int
Wait blocks waiting for the counter value to reach zero or for the timeout to be reached. Is guaranteed to wait for at least a hundred milliseconds regardless of given duration if the counter is positive value.
Click to show internal directories.
Click to hide internal directories.