Documentation ¶
Index ¶
- type Options
- type State
- type Worker
- func (this *Worker) CmpAndSwapState(old, new State) bool
- func (this *Worker) Debug() *Worker
- func (this *Worker) Push(job interface{})
- func (this *Worker) Run()
- func (this *Worker) SetState(state State)
- func (this *Worker) State() State
- func (this *Worker) Stop()
- func (this *Worker) WithLazyInterval(d time.Duration) *Worker
- func (this *Worker) WithLazySize(size int) *Worker
- func (this *Worker) WithLogger(logger logs.Logger) *Worker
- func (this *Worker) WithParallel(enable bool) *Worker
- func (this *Worker) WithQueueSize(size int) *Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { QueueSize int LazySize int LazyInterval time.Duration Parallel bool Logger logs.Logger // contains filtered or unexported fields }
func DefaultOptions ¶
func DefaultOptions() *Options
type State ¶
type State int32
const ( StateCreated State // created StateRunning // running StateStopping // stopping StateStopped // stopped )
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) CmpAndSwapState ¶
func (*Worker) WithLazySize ¶
func (*Worker) WithParallel ¶
func (*Worker) WithQueueSize ¶
Click to show internal directories.
Click to hide internal directories.