Documentation ¶
Index ¶
- type Options
- type State
- type Worker
- func (this *Worker) Debug() *Worker
- func (this *Worker) Push(job interface{})
- func (this *Worker) Run()
- 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) WithQueueSize(size int) *Worker
- func (this *Worker) WithSerialization(enable bool) *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 Serialization bool // 是否串行化执行, 默认true,保持数据处理的顺序 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) WithLazySize ¶
func (*Worker) WithQueueSize ¶
func (*Worker) WithSerialization ¶
Click to show internal directories.
Click to hide internal directories.