// Watch sends tasks from the Tasks channel unless an empty string is sent.
// Then an error is returned.
Watch sends tasks from the Tasks channel unless an empty string is sent.
Then an error is returned.
// Watch sends tasks from the Tasks channel unless an empty string is sent . // Then an error is returned .
func (c *TestCoord) Watch(out chan<- Task) error {
	var task Task
	for {
		select {
		case task = <-c.Tasks:
			Debugf("TestCoord recvd: %s", task)
			if task == nil || task.ID() == "" {
				return errors.New("test error")
			}
		case <-c.closed:
			return nil
		}
		select {
		case out <- task:
			Debugf("TestCoord sent: %s", task)
		case <-c.closed:
			return nil
		}
	}
}
func ( c * TestCoord ) Watch ( out chan <- Task ) error { var task Task for { select { case task = <- c . Tasks : Debugf ( " " , task ) if task == nil || task . ID ( ) == " " { return errors . New ( " " ) } case <- c . closed : return nil } select { case out <- task : Debugf ( " " , task ) case <- c . closed : return nil } } }
Watch sends tasks from the Tasks channel unless an empty string is sent.
Watch sends tasks from the Tasks channel unless an empty string is sent .