Documentation ¶
Overview ¶
Package runner implements running a job.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
A Factory takes a proto.Job, creates a corresponding job.Job interface for it, and passes both to NewRunner to make a Runner.
type Repo ¶
type Repo interface { Set(key string, value Runner) Remove(key string) Items() (map[string]Runner, error) }
Repo is a small wrapper around a concurrent map that provides the ability to store and retreive Runners in a thread-safe way.
type Runner ¶
type Runner interface { // Run runs the job, blocking until it has completed or when Stop is called. // If the job fails, Run will retry it as many times as the job is configured // to be retried. After each run attempt, a Job Log is created and sent to // the RM. When the job successfully completes, or reaches the maximum number // of retry attempts, Run returns the final state of the job. Run(jobData map[string]interface{}) byte // Stop stops the job if it's running. The job is responsible for stopping // quickly because Stop blocks while waiting for the job to stop. Stop() error // Status returns the status of the job as reported by the job. The job // is responsible for handling status requests asynchronously while running. Status() string }
A Runner runs and manages one job in a job chain. The job must implement the job.Job interface.
Click to show internal directories.
Click to hide internal directories.