state

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrTaskTerminal

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

func (ErrTaskTerminal) Error

func (e ErrTaskTerminal) Error() string

type State

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

State is an in-memory structure for keeping track of tasks. The State is updated when provided a mesos.TaskStatus via the Update method. If a task is encounted that was not specified during the creation of State it will panic.

func New

func New(tasks []*mesos.TaskInfo, restart bool) *State

func (*State) Append

func (s *State) Append(task *mesos.TaskInfo)

Append pushes the task into the pending chan.

func (*State) Done

func (s *State) Done()

Toggle shutdown

func (*State) Monitor

func (s *State) Monitor() (err error)

func (*State) Pop

func (s *State) Pop() *mesos.TaskInfo

Pending returns the next task waiting to be scheduled. If a returned task is not scheduled the caller must return via Append or the Task will be lost.

func (*State) Total

func (s *State) Total() int

Total returns the total number of tasks.

func (*State) Update

func (s *State) Update(status mesos.TaskStatus)

Update places the TaskStatus into the updates channel

Jump to

Keyboard shortcuts

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