// Pending returns the next task group waiting
// to be scheduled. If a returned group is not
// scheduled the caller must return it via
// Append or it will be lost.
Pending returns the next task group waiting
to be scheduled. If a returned group is not
scheduled the caller must return it via
Append or it will be lost.
// Pending returns the next task group waiting // to be scheduled . If a returned group is not // scheduled the caller must return it via // Append or it will be lost .
func (s *State) Pop() *mesosfile.Group {
	if s.sync && s.last != mesos.TASK_FINISHED {
		return nil
	}
	select {
	case group := <-s.pending:
		if s.sync {
			s.last = mesos.TaskState(0)
		}
		return group
	default:
	}
	return nil
}
func ( s * State ) Pop ( ) * mesosfile . Group { if s . sync && s . last != mesos . TASK_FINISHED { return nil } select { case group := <- s . pending : if s . sync { s . last = mesos . TaskState ( 0 ) } return group default : } return nil }
Pending returns the next task group waiting
to be scheduled.
Pending returns the next task group waiting to be scheduled .
// If running task groups synchronously each subsequent group (and task) must reach // TASK_FINISHED before the next task is available for scheduling. // Reset last to TASK_STARTING to avoid a race condition