traverser

package
v0.0.0-...-b973768 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobReaper

type JobReaper interface {
	// Run reaps done jobs from doneJobChan, saving their states and enqueueing
	// any jobs that should be run to runJobChan. When there are no more jobs to
	// reap, Run finalizes the traverser and returns.
	Run(ctx context.Context)

	// Stop stops the JobReaper from reaping any more jobs. It blocks until
	// Run() returns.
	Stop(ctx context.Context)
}

JobReaper handles jobs and chains that have finished running.

type Traverser

type Traverser interface {
	// Run traverses a job traverser and runs all of the jobs in it. It starts by
	// running the first job in the traverser, and then, if the job completed,
	// successfully, running its adjacent jobs. This process continues until there
	// are no more jobs to run, or until the Stop method is called on the traverser.
	Run(ctx context.Context)

	// Stop makes a traverser stop traversing its job traverser. It also sends a stop
	// signal to all of the jobs that a traverser is running.
	//
	// It returns an error if it fails to stop all running jobs.
	Stop(ctx context.Context) error
}

A Traverser provides the ability to run a job traverser while respecting the dependencies between the jobs.

Jump to

Keyboard shortcuts

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