func convertStreamToLineChannel(label string, stream io.ReadCloser) <-chan string {
	ch := make(chan string, 1)
	go func() {
		defer close(ch)
		scanner := bufio.NewScanner(stream)
		if glog.V(2) {
			glog.Infof("stream: %s - starting scan loop", label)
		}
		for scanner.Scan() {
			line := scanner.Text()
			if glog.V(2) {
				glog.Infof("stream %s: forwarding \"%s\"", label, line)
			}
			ch <- line
		}
		if err := scanner.Err(); err != nil {
			if glog.V(2) {
				glog.Infof("stream %s: error in scanner : %s", label, err.Error())
			}
			ch <- MsgError + " : " + err.Error()
			return
		}
		if glog.V(2) {
			glog.Infof("stream %s: done reading", label)
		}
	}()
	return ch
}
convertStreamToLineChannel returns a string channel to which it writes _lines_.
The lines are pulled from an IO stream.

Basically, this function just converts the problem of reading lines of text
from a stream to one of reading strings from a channel. Stream errors are
converted to special messages on the channel.

When the stream ends, the channel closes.
package scanner
import (
	"bufio"
	"github.com/golang/glog"
	"io"
	"time"
)
const MsgHappy = "MDRIP_HAPPY_Completed_command_block"
const MsgError = "MDRIP_ERROR_Problem_while_processing_command_block"
const MsgTimeout = "MDRIP_TIMEOUT_Command_block_did_not_finish_in_allotted_time"