Documentation ¶
Index ¶
- Constants
- func CRunTask(ctx context.Context, tasks ...TaskE) error
- func CRunTaskE(ctx context.Context, tasks ...TaskE) (timeout bool, errs error)
- func Cap() int
- func ErrWrap(old, new error) error
- func Free() int
- func Release() error
- func RunTask(ctx context.Context, tasks ...TaskE) error
- func Running() int
- func SetLog(grpoolLog Logger)
- func Submit(task func()) error
- func Tune(size int)
- type DispatchType
- type GrFuncPool
- type GrPool
- type Logger
- type TaskE
- type TaskGroup
Constants ¶
View Source
const ( BreakByError = true NoBreak = false SerialDispatch DispatchType = iota ConcurrentDispatch )
Variables ¶
This section is empty.
Functions ¶
func CRunTask ¶
CRunTask concurrence run all tasks. if any task has return error, all tasks will be killed (Don't take it too seriously) return the first error.
func CRunTaskE ¶
CRunTaskE concurrence run all tasks. if any task has return error, all tasks will not be killed (Don't take it too seriously) return all errors.
Types ¶
type DispatchType ¶
type DispatchType int
type GrFuncPool ¶
type GrFuncPool struct {
*ants.PoolWithFunc
}
============================================================================= pool with function
func NewPoolWithFunc ¶
func NewPoolWithFunc(size int, pf func(interface{})) (*GrFuncPool, error)
Pool with a argument
func NewTimingPoolWithFunc ¶
func NewTimingPoolWithFunc(size int, expiry time.Duration, pf func(interface{})) (*GrFuncPool, error)
Click to show internal directories.
Click to hide internal directories.