Documentation ¶
Index ¶
- Variables
- func IsTaskAlreadyRunningError(err error) bool
- type FuncTask
- type GenericTask
- func (t *GenericTask) BeforeStart(a interface{}) error
- func (t *GenericTask) Cancel() error
- func (t *GenericTask) Ctx() context.Context
- func (t *GenericTask) Err() error
- func (t *GenericTask) GetCreationTime() time.Time
- func (t *GenericTask) GetKey() string
- func (t *GenericTask) GetModifiedTime() time.Time
- func (t *GenericTask) GetNS() string
- func (t *GenericTask) IsCompleted() bool
- func (t *GenericTask) IsFailed() bool
- func (t *GenericTask) IsRunning() bool
- func (t *GenericTask) OnFailure() error
- func (t *GenericTask) OnSuccess() error
- func (t *GenericTask) SetProgress(p int32)
- func (t *GenericTask) Stat() *TaskStat
- func (t *GenericTask) Wait()
- type Pool
- func (p *Pool) Cancel(key string)
- func (p *Pool) Err(key string) error
- func (p *Pool) List() []string
- func (p *Pool) RunFunc(ctx context.Context, key string, fn func(*log.Entry) error) (string, error)
- func (p *Pool) StartTask(ctx context.Context, t Task, resp interface{}) (string, error)
- func (p *Pool) Stat(key string) *TaskStat
- func (p *Pool) Wait(key string)
- func (p *Pool) WaitAndClosePool()
- type Task
- type TaskAlreadyRunningError
- type TaskStat
- type TaskState
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTaskNotRunning = errors.New("process is not running") ErrTaskInterrupted = errors.New("process was interrupted") ErrUninterruptibleTask = errors.New("unable to cancel uninterruptible process") )
View Source
var (
ErrPoolClosed = errors.New("pool is closed")
)
Functions ¶
Types ¶
type FuncTask ¶
type FuncTask struct { *GenericTask // contains filtered or unexported fields }
type GenericTask ¶
It's an implementation of a generic task
func (*GenericTask) BeforeStart ¶
func (t *GenericTask) BeforeStart(a interface{}) error
func (*GenericTask) Cancel ¶
func (t *GenericTask) Cancel() error
func (*GenericTask) Ctx ¶
func (t *GenericTask) Ctx() context.Context
func (*GenericTask) GetCreationTime ¶
func (t *GenericTask) GetCreationTime() time.Time
func (*GenericTask) GetKey ¶
func (t *GenericTask) GetKey() string
func (*GenericTask) GetModifiedTime ¶
func (t *GenericTask) GetModifiedTime() time.Time
func (*GenericTask) GetNS ¶
func (t *GenericTask) GetNS() string
func (*GenericTask) IsCompleted ¶
func (t *GenericTask) IsCompleted() bool
func (*GenericTask) IsFailed ¶
func (t *GenericTask) IsFailed() bool
func (*GenericTask) IsRunning ¶
func (t *GenericTask) IsRunning() bool
func (*GenericTask) OnFailure ¶
func (t *GenericTask) OnFailure() error
func (*GenericTask) OnSuccess ¶
func (t *GenericTask) OnSuccess() error
func (*GenericTask) SetProgress ¶
func (t *GenericTask) SetProgress(p int32)
func (*GenericTask) Stat ¶
func (t *GenericTask) Stat() *TaskStat
func (*GenericTask) Wait ¶
func (t *GenericTask) Wait()
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) WaitAndClosePool ¶
func (p *Pool) WaitAndClosePool()
type TaskAlreadyRunningError ¶
func (*TaskAlreadyRunningError) Error ¶
func (e *TaskAlreadyRunningError) Error() string
Click to show internal directories.
Click to hide internal directories.