Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncWorkers ¶
type AsyncWorkers struct {
// contains filtered or unexported fields
}
func NewAsyncWorkers ¶
func NewAsyncWorkers(name string) *AsyncWorkers
func (*AsyncWorkers) Start ¶
func (aws *AsyncWorkers) Start(stopCh <-chan struct{}) error
type Work ¶
type Work struct {
// Fn is the function to handle the work,
// its first param must be of type context.Context,
// it's allowed to have any number of other parameters of any type,
// and can have only one return value with error type,
// its prototype likes func(ctx context.Context, i int, s string, ...) error
Fn interface{}
// Params are parameters of the fn
Params []interface{}
// DeliverAt is the time at which the work is delivered
DeliveredAt time.Time
}
work contains details to handle by workers
Click to show internal directories.
Click to hide internal directories.