Documentation
¶
Index ¶
Constants ¶
View Source
const WorkNameSeperator = "/"
WorkNameSeperator is used to assemble standard work-name and we have assumptions below, for work-name 'a/b/c': - 'a' and 'b' are specified identifiers for objects/triggers(etc.) on the action - 'c' is a general identifier for actions
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AsyncWorkers ¶
type AsyncWorkers struct {
// contains filtered or unexported fields
}
func NewAsyncWorkers ¶
func NewAsyncWorkers(name string, emitter metrics.MetricEmitter) *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.