engine

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: BSD-3-Clause Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutorunCollector

func AutorunCollector(ctx context.Context) error

AutorunCollector launches a process that looks for existing resolutions with state TO_AUTORUN, and passes them to the engine for execution

func GarbageCollector

func GarbageCollector(ctx context.Context, completedTaskExpiration string) error

GarbageCollector launches a process that cleans up finished tasks (ie are in a final state) older than a given threshold

func Init

func Init(ctx context.Context, wg *sync.WaitGroup, store *configstore.Store) error

Init launches the task orchestration engine, providing it with a global context and with a store from which to inherit configuration items needed for task execution

func InstanceCollector

func InstanceCollector(ctx context.Context, maxConcurrentExecutions int, waitDuration time.Duration) error

InstanceCollector launches a process that retrieves resolutions which might have been running on a dead instance and marks them as crashed, for examination

func RetryCollector

func RetryCollector(ctx context.Context) error

RetryCollector launches a process that collects all resolutions eligible for a new run and passes them to the engine for execution

Types

type Engine

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

Engine is the heart of utask: it is the active process that handles the lifecycle of every task resolution. All the logic for resolution state changes is expressed here - the engine determines which steps in a resolution are eligible for execution, and which should be pruned - the engine computes step dependencies - the conditions expressed in a step (skip/check) that impact resolution state are enforced by the engine

func GetEngine

func GetEngine() Engine

GetEngine returns the singleton instance of Engine

func (Engine) Resolve

func (e Engine) Resolve(publicID string, sm *semaphore.Weighted) error

Resolve launches the asynchronous execution of a resolution, given its ID

func (Engine) SyncResolve

func (e Engine) SyncResolve(publicID string, sm *semaphore.Weighted) (*resolution.Resolution, error)

SyncResolve launches the synchronous execution of a resolution, given its ID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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