Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Concurrent ¶
type Concurrent struct {
// contains filtered or unexported fields
}
Concurrent is an executor for concurrent executions
func NewConcurrent ¶
func NewConcurrent(ctx context.Context, engine *engine.Engine, completionBlock bool, opts ...ConcurrentOption) *Concurrent
NewConcurrent - initializes concurrent executor; if completionBlock=true, it will block main routine until all tasks completed
func (*Concurrent) Add ¶
func (e *Concurrent) Add(executable Executable)
Add - adds an executable to the executables list
func (*Concurrent) Execute ¶
func (c *Concurrent) Execute() error
Execute - executes all executables concurrently
func (*Concurrent) IsCompleted ¶
func (e *Concurrent) IsCompleted() bool
IsCompleted - returns completion status
func (*Concurrent) OnFailure ¶
func (c *Concurrent) OnFailure(err error)
OnFailure - handles failure callback
func (*Concurrent) OnSuccess ¶
func (c *Concurrent) OnSuccess()
OnSuccess - handles completion callback
type ConcurrentOption ¶ added in v0.2.1
type ConcurrentOption func(*Concurrent)
func ConcurrentFailHandler ¶ added in v0.2.1
func ConcurrentFailHandler(fail func(err error)) ConcurrentOption
ConcurrentFailHandler - inits fail handler
func ConcurrentSuccessHandler ¶ added in v0.2.1
func ConcurrentSuccessHandler(success func()) ConcurrentOption
ConcurrentSuccessHandler - inits success handler
type Executable ¶
Executable - interface for executables
type Parallel ¶
type Parallel struct {
// contains filtered or unexported fields
}
Parallel is an executor for parallel executions
func NewParallel ¶
func NewParallel(ctx context.Context, opts ...ParallelOption) *Parallel
NewParallel - initializes a parallel executor
func (*Parallel) Add ¶
func (e *Parallel) Add(executable Executable)
Add - adds an executable to the executables list
func (*Parallel) IsCompleted ¶
func (e *Parallel) IsCompleted() bool
IsCompleted - returns completion status
type ParallelOption ¶ added in v0.2.1
type ParallelOption func(parallel *Parallel)
func ParallelFailHandler ¶ added in v0.2.1
func ParallelFailHandler(fail func(err error)) ParallelOption
ParallelFailHandler - inits fail handler
func ParallelSuccessHandler ¶ added in v0.2.1
func ParallelSuccessHandler(success func()) ParallelOption
ParallelSuccessHandler - inits success handler
type Sequence ¶
type Sequence struct {
// contains filtered or unexported fields
}
Sequence is an executor for sequential executions
func NewSequence ¶
func NewSequence(ctx context.Context, opts ...SequenceOption) *Sequence
NewSequence - initializes a sequence executor
func (*Sequence) Add ¶
func (e *Sequence) Add(executable Executable)
Add - adds an executable to the executables list
func (*Sequence) IsCompleted ¶
func (e *Sequence) IsCompleted() bool
IsCompleted - returns completion status
type SequenceOption ¶ added in v0.2.1
type SequenceOption func(*Sequence)
func SequenceFailHandler ¶ added in v0.2.1
func SequenceFailHandler(fail func(err error)) SequenceOption
SequenceFailHandler - inits fail handler
func SequenceSuccessHandler ¶ added in v0.2.1
func SequenceSuccessHandler(success func()) SequenceOption
SequenceSuccessHandler - inits success handler