runtasksconcurrent

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "run_tasks_concurrent"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Runs multiple tasks in parallel.",
		Config:      DefaultConfig(),
		NewTask:     NewTask,
	}
)

Functions

func NewTask

func NewTask(ctx *types.TaskContext, options *types.TaskOptions) (types.Task, error)

Types

type Config

type Config struct {
	// number of successful child tasks to make this task succeed (0 = all tasks)
	SucceedTaskCount uint64 `yaml:"succeedTaskCount" json:"succeedTaskCount"`

	// number of failed child tasks to make this task fail (0 = all tasks)
	FailTaskCount uint64 `yaml:"failTaskCount" json:"failTaskCount"`

	// child tasks
	Tasks []helper.RawMessage `yaml:"tasks" json:"tasks"`
}

func DefaultConfig

func DefaultConfig() Config

func (*Config) Validate

func (c *Config) Validate() error

type Task

type Task struct {
	// contains filtered or unexported fields
}

func (*Task) Config

func (t *Task) Config() interface{}

func (*Task) Description

func (t *Task) Description() string

func (*Task) Execute

func (t *Task) Execute(ctx context.Context) error

func (*Task) LoadConfig

func (t *Task) LoadConfig() error

func (*Task) Logger

func (t *Task) Logger() logrus.FieldLogger

func (*Task) Name

func (t *Task) Name() string

func (*Task) Timeout

func (t *Task) Timeout() time.Duration

func (*Task) Title

func (t *Task) Title() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL