Documentation ¶
Index ¶
- func AntsInit()
- func AntsRunner(fns ...util.Func) error
- func DryRun(fns ...util.Func) error
- func Go(wg *sync.WaitGroup, ignoreRecover bool, ...)
- func Run(fns ...util.Func) error
- func TaskConverter(fns ...util.Fn) []util.Func
- type Option
- func WithContext(context context.Context) Option
- func WithDeadlineCancel(deadline time.Time) Option
- func WithErrCancel() Option
- func WithErrDryRun() Option
- func WithLimit(limit int) Option
- func WithPanicRecover() Option
- func WithProgressReport(bar chan<- int) Option
- func WithTimeoutCancel(timeout time.Duration) Option
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AntsRunner ¶
Types ¶
type Option ¶
type Option func(r *Runner)
func WithContext ¶
func WithDeadlineCancel ¶
func WithErrCancel ¶
func WithErrCancel() Option
func WithErrDryRun ¶
func WithErrDryRun() Option
func WithPanicRecover ¶
func WithPanicRecover() Option
func WithProgressReport ¶
func WithTimeoutCancel ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner
- Runner
- 1. context injection
- 2. goroutine limit control
- 3. error catch mode:
- (1). one error cancel all: return error
- (2). any error dry run: collect errors, return mergedError
- (3). any panic recover: collect errors, return mergedError, collect stacktrace,
- 4. timeout control
- 5. progress report
Click to show internal directories.
Click to hide internal directories.