func (cfg *Config) StartStream() (*Stream, error) {
	if err := cfg.createCmd(); err != nil {
		return nil, err
	}
	pt, err := pty.Start(cfg.cmd)
	if err != nil {
		return nil, err
	}
	str := &Stream{
		cmd: cfg.cmd,
		pmu: sync.Mutex{},
		pt:  pt,
		wg:  sync.WaitGroup{},
		rmu: sync.RWMutex{},
		queue:   make([]Row, 0, 500),
		pid2Row: make(map[int64]Row, 500),
		err:     nil,
		errc:    make(chan error, 1),
		ready:  false,
		readyc: make(chan struct{}, 1),
	}
	str.rcond = sync.NewCond(&str.rmu)
	str.wg.Add(1)
	go str.enqueue()
	go str.dequeue()
	<-str.readyc
	return str, nil
}
StartStream starts 'top' command stream.
package top
import (
	"bufio"
	"bytes"
	"os"
	"os/exec"
	"strings"
	"sync"
	"github.com/kr/pty"
)
type Stream struct {
	cmd *exec.Cmd
	pmu sync.Mutex
	pt  *os.File
	wg      sync.WaitGroup
	rcond   *sync.Cond
	rmu     sync.RWMutex  
	queue   []Row
	pid2Row map[int64]Row
	err     error
	errc    chan error
	readymu sync.Mutex
	ready   bool
	readyc  chan struct{}
}