Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
Execute runs a list of tasks sequentially, returns the first error encountered or nil if all tasks pass.
Types ¶
type ActivityTimer ¶
type ActivityTimer struct {
// contains filtered or unexported fields
}
func CancelAfterInactivity ¶
func CancelAfterInactivity(ctx context.Context, cancel context.CancelFunc, timeout time.Duration) *ActivityTimer
func (*ActivityTimer) SetTimeout ¶
func (t *ActivityTimer) SetTimeout(timeout time.Duration)
func (*ActivityTimer) Update ¶
func (t *ActivityTimer) Update()
type ActivityUpdater ¶
type ActivityUpdater interface {
Update()
}
type Done ¶
type Done struct {
// contains filtered or unexported fields
}
Done is a utility for notifications of something being done.
func (*Done) Close ¶
Close marks this Done 'done'. This method may be called multiple times. All calls after first call will have no effect on its status.
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier is a utility for notifying changes. The change producer may notify changes multiple time, and the consumer may get notified asynchronously.
type PeriodicTask ¶
type PeriodicTask struct { // Interval of the task being run Interval time.Duration // Execute is the task function Execute func() error // OnFailure will be called when Execute returns non-nil error OnError func(error) // contains filtered or unexported fields }
PeriodicTask is a task that runs periodically.
func (*PeriodicTask) Start ¶
func (t *PeriodicTask) Start() error
Start implements common.Runnable. Start must not be called multiple times without Close being called.
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
Semaphore is an implementation of semaphore.
func NewSemaphore ¶
NewSemaphore create a new Semaphore with n permits.