Documentation
¶
Overview ¶
Package worker provides functions for running tasks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Descriptor ¶
Descriptor represents a descriptor.
type Job ¶
type Job struct { Descriptor Descriptor Fn func(ctx context.Context, args ...interface{}) (interface{}, error) Args []interface{} }
Job represents a worker job which executes the given function.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool represents a worker pool which runs concurrent workers and jobs.
type Result ¶
type Result struct { Descriptor Descriptor Value interface{} Error error }
Result represents a result.
Click to show internal directories.
Click to hide internal directories.