Documentation ¶
Index ¶
- func GetFastestTaskResult(fnList []func() (out interface{}, err error)) (out interface{}, err error)
- func MustRunFunctionListConcurrentPassByPanic(fnList ...func())
- func RunFunctionListConcurrent(fnList ...func())
- func RunTask(threadNum int, funcList ...func())
- func RunTaskRepeat(f func(), num int)
- func RunTaskRepeatWithLimitThread(f func(), taskNum int, threadNum int)
- type ConcurrentLimitedTaskManager
- func (tm *ConcurrentLimitedTaskManager) AddTask(doFunc taskDoFunc, closer func())
- func (tm *ConcurrentLimitedTaskManager) Cancel()
- func (tm *ConcurrentLimitedTaskManager) FairRunAllAndClose(isCloseAll bool) error
- func (tm *ConcurrentLimitedTaskManager) FairRunGetFastestAndClose(isCloseFastest bool) (out interface{}, err error)
- func (tm *ConcurrentLimitedTaskManager) IsStarted() bool
- func (tm *ConcurrentLimitedTaskManager) UnfairRunAndClose(isCloseFastest bool) (out interface{}, err error)
- type ErrorTaskFn
- type GetFastestTaskResultRunner
- type GetFastestTaskResultRunnerV2
- func (r *GetFastestTaskResultRunnerV2) Add(fn func() (out interface{}, err error))
- func (r *GetFastestTaskResultRunnerV2) AddUpperCloser(closer *udwClose.Closer)
- func (r *GetFastestTaskResultRunnerV2) AddWithCloser(doFn func() (out interface{}, err error), closer func())
- func (r *GetFastestTaskResultRunnerV2) Close()
- func (r *GetFastestTaskResultRunnerV2) GrowToSize(size int)
- func (r *GetFastestTaskResultRunnerV2) Run() (out interface{}, err error)
- func (r *GetFastestTaskResultRunnerV2) RunIsNotCloseFastest(isNotCloseFastest bool) (out interface{}, err error)
- func (r *GetFastestTaskResultRunnerV2) RunReturnBool() bool
- type LimitMaxThreadTaskManager
- type LimitThreadErrorHandleTaskManager
- type LimitThreadTaskManager
- type LimitThreadTaskManagerV2
- type LimitThreadTaskManagerV3
- type NewTimeoutRankManagerRequest
- type SimpleTaskManager
- type Task
- type TaskFunc
- type TaskManager
- type TimeoutRankManager
- type TimeoutRankTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFastestTaskResult ¶
func MustRunFunctionListConcurrentPassByPanic ¶
func MustRunFunctionListConcurrentPassByPanic(fnList ...func())
func RunFunctionListConcurrent ¶
func RunFunctionListConcurrent(fnList ...func())
func RunTaskRepeat ¶
func RunTaskRepeat(f func(), num int)
Types ¶
type ConcurrentLimitedTaskManager ¶
type ConcurrentLimitedTaskManager struct {
// contains filtered or unexported fields
}
func MustNewConcurrentLimitedTaskManager ¶
func MustNewConcurrentLimitedTaskManager(limited int) *ConcurrentLimitedTaskManager
func (*ConcurrentLimitedTaskManager) AddTask ¶
func (tm *ConcurrentLimitedTaskManager) AddTask(doFunc taskDoFunc, closer func())
func (*ConcurrentLimitedTaskManager) Cancel ¶
func (tm *ConcurrentLimitedTaskManager) Cancel()
func (*ConcurrentLimitedTaskManager) FairRunAllAndClose ¶
func (tm *ConcurrentLimitedTaskManager) FairRunAllAndClose(isCloseAll bool) error
func (*ConcurrentLimitedTaskManager) FairRunGetFastestAndClose ¶
func (tm *ConcurrentLimitedTaskManager) FairRunGetFastestAndClose(isCloseFastest bool) (out interface{}, err error)
func (*ConcurrentLimitedTaskManager) IsStarted ¶
func (tm *ConcurrentLimitedTaskManager) IsStarted() bool
func (*ConcurrentLimitedTaskManager) UnfairRunAndClose ¶
func (tm *ConcurrentLimitedTaskManager) UnfairRunAndClose(isCloseFastest bool) (out interface{}, err error)
type ErrorTaskFn ¶
type ErrorTaskFn func() (err error)
type GetFastestTaskResultRunner ¶
type GetFastestTaskResultRunner []func() (out interface{}, err error)
func NewGetFastestTaskResultRunner ¶
func NewGetFastestTaskResultRunner() *GetFastestTaskResultRunner
func (*GetFastestTaskResultRunner) Add ¶
func (r *GetFastestTaskResultRunner) Add(fn func() (out interface{}, err error))
func (*GetFastestTaskResultRunner) AddReturnBool ¶
func (r *GetFastestTaskResultRunner) AddReturnBool(fn func() bool)
func (*GetFastestTaskResultRunner) Run ¶
func (r *GetFastestTaskResultRunner) Run() (out interface{}, err error)
func (*GetFastestTaskResultRunner) RunReturnBool ¶
func (r *GetFastestTaskResultRunner) RunReturnBool() bool
type GetFastestTaskResultRunnerV2 ¶
type GetFastestTaskResultRunnerV2 struct {
// contains filtered or unexported fields
}
func NewGetFastestTaskResultRunnerV2 ¶
func NewGetFastestTaskResultRunnerV2() *GetFastestTaskResultRunnerV2
func (*GetFastestTaskResultRunnerV2) Add ¶
func (r *GetFastestTaskResultRunnerV2) Add(fn func() (out interface{}, err error))
func (*GetFastestTaskResultRunnerV2) AddUpperCloser ¶
func (r *GetFastestTaskResultRunnerV2) AddUpperCloser(closer *udwClose.Closer)
func (*GetFastestTaskResultRunnerV2) AddWithCloser ¶
func (r *GetFastestTaskResultRunnerV2) AddWithCloser(doFn func() (out interface{}, err error), closer func())
func (*GetFastestTaskResultRunnerV2) Close ¶
func (r *GetFastestTaskResultRunnerV2) Close()
func (*GetFastestTaskResultRunnerV2) GrowToSize ¶
func (r *GetFastestTaskResultRunnerV2) GrowToSize(size int)
func (*GetFastestTaskResultRunnerV2) Run ¶
func (r *GetFastestTaskResultRunnerV2) Run() (out interface{}, err error)
func (*GetFastestTaskResultRunnerV2) RunIsNotCloseFastest ¶
func (r *GetFastestTaskResultRunnerV2) RunIsNotCloseFastest(isNotCloseFastest bool) (out interface{}, err error)
func (*GetFastestTaskResultRunnerV2) RunReturnBool ¶
func (r *GetFastestTaskResultRunnerV2) RunReturnBool() bool
type LimitMaxThreadTaskManager ¶
type LimitMaxThreadTaskManager struct {
// contains filtered or unexported fields
}
func New ¶
func New(num_thread int) *LimitMaxThreadTaskManager
func (*LimitMaxThreadTaskManager) AddFunc ¶
func (tm *LimitMaxThreadTaskManager) AddFunc(f func())
func (*LimitMaxThreadTaskManager) AddFuncSync ¶
func (t *LimitMaxThreadTaskManager) AddFuncSync(f func())
func (*LimitMaxThreadTaskManager) Close ¶
func (tm *LimitMaxThreadTaskManager) Close()
func (*LimitMaxThreadTaskManager) WaitAndNotClose ¶
func (t *LimitMaxThreadTaskManager) WaitAndNotClose()
type LimitThreadErrorHandleTaskManager ¶
type LimitThreadErrorHandleTaskManager struct { ErrorArr []error // contains filtered or unexported fields }
func NewLimitThreadErrorHandleTaskManager ¶
func NewLimitThreadErrorHandleTaskManager(threadNum int, retryNum int) *LimitThreadErrorHandleTaskManager
func (*LimitThreadErrorHandleTaskManager) AddTask ¶
func (m *LimitThreadErrorHandleTaskManager) AddTask(task ErrorTaskFn)
func (*LimitThreadErrorHandleTaskManager) Close ¶
func (m *LimitThreadErrorHandleTaskManager) Close()
func (*LimitThreadErrorHandleTaskManager) GetError ¶
func (m *LimitThreadErrorHandleTaskManager) GetError() error
func (*LimitThreadErrorHandleTaskManager) Wait ¶
func (m *LimitThreadErrorHandleTaskManager) Wait()
type LimitThreadTaskManager ¶
type LimitThreadTaskManager struct {
// contains filtered or unexported fields
}
func NewLimitThreadTaskManager ¶
func NewLimitThreadTaskManager(num_thread int) *LimitThreadTaskManager
func (*LimitThreadTaskManager) AddFunc ¶
func (t *LimitThreadTaskManager) AddFunc(f func())
func (*LimitThreadTaskManager) AddTask ¶
func (t *LimitThreadTaskManager) AddTask(task Task)
func (*LimitThreadTaskManager) AddTaskNewThread ¶
func (t *LimitThreadTaskManager) AddTaskNewThread(task Task)
func (*LimitThreadTaskManager) Close ¶
func (t *LimitThreadTaskManager) Close()
func (*LimitThreadTaskManager) Wait ¶
func (t *LimitThreadTaskManager) Wait()
func (*LimitThreadTaskManager) WaitAndClose ¶
func (t *LimitThreadTaskManager) WaitAndClose()
type LimitThreadTaskManagerV2 ¶
type LimitThreadTaskManagerV2 struct {
// contains filtered or unexported fields
}
func NewLimitThreadTaskManagerV2 ¶
func NewLimitThreadTaskManagerV2(num_thread int) *LimitThreadTaskManagerV2
func NewLimitThreadTaskManagerV2NoBuffer ¶
func NewLimitThreadTaskManagerV2NoBuffer(num_thread int) *LimitThreadTaskManagerV2
func (*LimitThreadTaskManagerV2) AddFunc ¶
func (t *LimitThreadTaskManagerV2) AddFunc(f func())
func (*LimitThreadTaskManagerV2) Close ¶
func (t *LimitThreadTaskManagerV2) Close()
func (*LimitThreadTaskManagerV2) CloseAsync ¶
func (t *LimitThreadTaskManagerV2) CloseAsync()
func (*LimitThreadTaskManagerV2) SetThreadNum ¶
func (t *LimitThreadTaskManagerV2) SetThreadNum(num_thread int)
func (*LimitThreadTaskManagerV2) WaitAndNotClose ¶
func (t *LimitThreadTaskManagerV2) WaitAndNotClose()
type LimitThreadTaskManagerV3 ¶
type LimitThreadTaskManagerV3 []limitThreadTaskManagerV3Job
func NewLimitThreadTaskManagerV3 ¶
func NewLimitThreadTaskManagerV3(threadNumber int) *LimitThreadTaskManagerV3
func (*LimitThreadTaskManagerV3) Add ¶
func (m *LimitThreadTaskManagerV3) Add(job func(), closer func())
func (*LimitThreadTaskManagerV3) ForceCloseNotWaitForFinish ¶
func (m *LimitThreadTaskManagerV3) ForceCloseNotWaitForFinish()
func (*LimitThreadTaskManagerV3) Run ¶
func (m *LimitThreadTaskManagerV3) Run() error
func (*LimitThreadTaskManagerV3) RunAndNotClose ¶
func (m *LimitThreadTaskManagerV3) RunAndNotClose() error
type SimpleTaskManager ¶
type SimpleTaskManager struct {
// contains filtered or unexported fields
}
func NewSimpleTaskManager ¶
func NewSimpleTaskManager() *SimpleTaskManager
func (*SimpleTaskManager) AddFunc ¶
func (t *SimpleTaskManager) AddFunc(task func())
func (*SimpleTaskManager) AddTask ¶
func (t *SimpleTaskManager) AddTask(task Task)
func (*SimpleTaskManager) Close ¶
func (t *SimpleTaskManager) Close()
func (*SimpleTaskManager) Wait ¶
func (t *SimpleTaskManager) Wait()
type TaskManager ¶
type TaskManager interface { AddTask(t Task) Wait() Close() }
type TimeoutRankManager ¶
type TimeoutRankManager struct {
// contains filtered or unexported fields
}
func NewTimeoutRankManager ¶
func NewTimeoutRankManager(req NewTimeoutRankManagerRequest) *TimeoutRankManager
func (*TimeoutRankManager) Add ¶
func (manager *TimeoutRankManager) Add(job func() interface{}, closer func())
func (*TimeoutRankManager) ForceCloseNotWaitForFinish ¶
func (manager *TimeoutRankManager) ForceCloseNotWaitForFinish()
func (*TimeoutRankManager) Run ¶
func (manager *TimeoutRankManager) Run() ([]interface{}, error)
type TimeoutRankTask ¶
type TimeoutRankTask struct {
// contains filtered or unexported fields
}
Source Files ¶
- ConcurrentLimitedTaskManager.go
- FastestTaskResultRunnerV2.go
- FastestTaskRunner.go
- LimitMaxThreadTaskManager.go
- LimitThreadErrorHandleTaskManager.go
- LimitThreadTaskManagerV2_deprecated.go
- LimitThreadTaskManagerV3_deprecated.go
- LimitThreadTaskManager_deprecated.go
- RunFunctionListConcurrent.go
- SimpleTaskManager.go
- TaskManager.go
- TimeoutRank.go
Click to show internal directories.
Click to hide internal directories.