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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunningChainReaper

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

RunningChainReaper ...

func NewRunningChainReaper

func NewRunningChainReaper(grapher *graph.Grapher, logger *infra.Logger, doneJobChan, runJobChan chan job.Job) *RunningChainReaper

NewRunningChainReaper ...

func (*RunningChainReaper) Finalize

func (r *RunningChainReaper) Finalize(complete bool)

Finalize determines the final state of the chain

func (*RunningChainReaper) Reap

func (r *RunningChainReaper) Reap(job *job.Job)

Reap takes a job that just finished running, saves its final state, and prepares to continue running the chain (or recognizes that the chain is done running).

If chain is done: save final state + stop running more jobs. If job failed: retry sequence if possible. If job completed: prepared subsequent jobs and enqueue if runnable.

func (*RunningChainReaper) Run

func (r *RunningChainReaper) Run(ctx context.Context)

Run reaps jobs when they finish running. For each job reaped, if... - chain is done: save final state . - job failed: retry sequence if possible. - job completed: prepared subsequent jobs and enqueue if runnable.

func (*RunningChainReaper) Stop

func (r *RunningChainReaper) Stop(ctx context.Context)

Stop stops the reaper from reaping any more jobs. It blocks until the reaper is stopped (will reap no more jobs and Run will return).

type Traverser

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

Traverser ...

func NewTraverser

func NewTraverser(grapher *graph.Grapher, logger *infra.Logger, stopTimeout, sendTimeout time.Duration) *Traverser

NewTraverser ...

func (*Traverser) Run

func (t *Traverser) Run(ctx context.Context)

Run runs all jobs in the chain and blocks until the chain finishes running, is stopped.

func (*Traverser) Stop

func (t *Traverser) Stop(ctx context.Context) error

Stop stops the running job chain and stopping all currently running jobs.

Jump to

Keyboard shortcuts

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