package tasks
import "k8s.io/kubernetes/contrib/mesos/pkg/minion/tasks"
Package tasks provides an API for supervising system processes as Task's. It provides stronger guarantees with respect to process lifecycle than a standalone kubelet running static pods.
Index ¶
Types ¶
type Completion ¶
type Completion struct {
// contains filtered or unexported fields
}
Completion represents the termination of a Task process. Each process execution should yield (barring drops because of an abort signal) exactly one Completion.
type Events ¶
type Events interface { // Close stops delivery of events in the completion and errors channels; callers must close this when they intend to no longer read from completion() or errors() Close() Events // Completion reports Completion events as they happen Completion() <-chan *Completion // Done returns a signal chan that closes when all tasks have completed and there are no more events to deliver Done() <-chan struct{} }
func MergeOutput ¶
MergeOutput waits for the given tasks to complete. meanwhile it logs each time a task process completes or generates an error. when shouldQuit closes, tasks are canceled and this func eventually returns once all ongoing event handlers have completed running.
type Task ¶
type Task struct { Finished func(restarting bool) bool // callback invoked when a task process has completed; if `restarting` then it will be restarted if it returns true RestartDelay time.Duration // interval between repeated task restarts // contains filtered or unexported fields }
task is a specification for running a system process; it provides hooks for customizing logging and restart handling as well as provides event channels for communicating process termination and errors related to process management.
func New ¶
func New(name, bin string, args, env []string, cl func() io.WriteCloser) *Task
New builds a newly initialized task object but does not start any processes for it. callers are expected to invoke task.run(...) on their own.
func (*Task) Start ¶
func (t *Task) Start()
Start spawns a goroutine to execute the Task. Panics if invoked more than once.
Source Files ¶
doc.go events.go task.go task_other.go
- Version
- v1.1.9-beta.0
- Published
- Feb 23, 2016
- Platform
- js/wasm
- Imports
- 10 packages
- Last checked
- 19 minutes ago –
Tools for package owners.