Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultNumWorkers = 1
DefaultNumWorkers is the default number of workers
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatch ¶
type Dispatch struct { WorkerPool chan chan scheduler.Jobber NumWorkers int // contains filtered or unexported fields }
Dispatch is a dispatcher that executes jobs
func NewDispatch ¶
func NewDispatch(workerFactory WorkerFactorier, options ...OptionsFunc) *Dispatch
New creates a new dispatcher
func (*Dispatch) Options ¶
func (d *Dispatch) Options(opts ...OptionsFunc)
Options configure the stevedore command
type MockDispatch ¶
MockDispatch is a mock of Dispatch interface
func NewMockDispatch ¶
func NewMockDispatch() *MockDispatch
NewMockDispatch provides a mock of Dispatch interface
func (*MockDispatch) Enqueue ¶
func (m *MockDispatch) Enqueue(job scheduler.Jobber)
Enqueue provides a mock function with given fields: _a0, _a1
func (*MockDispatch) Start ¶
func (m *MockDispatch) Start(ctx context.Context, opts ...OptionsFunc) error
type OptionsFunc ¶
type OptionsFunc func(*Dispatch)
OptionsFunc is a function used to configure the dispatcher
func WithNumWorkers ¶
func WithNumWorkers(n int) OptionsFunc
Click to show internal directories.
Click to hide internal directories.