Documentation ¶
Index ¶
- Variables
- type DiscretWork
- type MonitoredWorker
- type State
- type WorkerPool
- func (wp *WorkerPool) AfterComplete(fn func())
- func (wp *WorkerPool) AppendWork(iv *MonitoredWorker)
- func (wp *WorkerPool) Completed() bool
- func (wp *WorkerPool) GetAllProgress() interface{}
- func (wp *WorkerPool) StartAll() []error
- func (wp *WorkerPool) State() State
- func (wp *WorkerPool) StopAll() []error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRunCompletedJob = errors.New("error: try run completed job") ErrRunRunningJob = errors.New("error: try run running job") ErrStopNonRunningJob = errors.New("error: imposible stop non running job") )
View Source
var States = map[State]string{
Stopped: `Stopped`,
Running: `Running`,
Failed: `Failed`,
Completed: `Completed`,
}
Functions ¶
This section is empty.
Types ¶
type DiscretWork ¶
type MonitoredWorker ¶
type MonitoredWorker struct { Itw DiscretWork // contains filtered or unexported fields }
func (*MonitoredWorker) GetId ¶
func (mw *MonitoredWorker) GetId() string
func (*MonitoredWorker) GetProgress ¶
func (mw *MonitoredWorker) GetProgress() interface{}
func (*MonitoredWorker) GetState ¶
func (mw *MonitoredWorker) GetState() State
func (*MonitoredWorker) Start ¶
func (mw *MonitoredWorker) Start() error
func (*MonitoredWorker) Stop ¶
func (mw *MonitoredWorker) Stop() error
func (*MonitoredWorker) Wait ¶
func (mw *MonitoredWorker) Wait()
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
func (*WorkerPool) AfterComplete ¶
func (wp *WorkerPool) AfterComplete(fn func())
func (*WorkerPool) AppendWork ¶
func (wp *WorkerPool) AppendWork(iv *MonitoredWorker)
func (*WorkerPool) Completed ¶
func (wp *WorkerPool) Completed() bool
func (*WorkerPool) GetAllProgress ¶
func (wp *WorkerPool) GetAllProgress() interface{}
func (*WorkerPool) StartAll ¶
func (wp *WorkerPool) StartAll() []error
func (*WorkerPool) State ¶
func (wp *WorkerPool) State() State
func (*WorkerPool) StopAll ¶
func (wp *WorkerPool) StopAll() []error
Click to show internal directories.
Click to hide internal directories.