code: func (r *reader) read() {
  	var reader = bufio.NewReader(r.r)
  	for {
  		// Check context error
  		if r.ctx.Err() != nil {
  			return
  		}
  
  		// Read next line
  		var b []byte
  		var err error
  		if b, err = reader.ReadBytes('\n'); err != nil {
  			if !r.isEOFErr(err) {
  				astilog.Errorf("%s while reading", err)
  				continue
  			}
  			return
  		}
  		b = bytes.TrimSpace(b)
  		astilog.Debugf("Astilectron says: %s", b)
  
  		// Unmarshal
  		var e Event
  		if err = json.Unmarshal(b, &e); err != nil {
  			astilog.Errorf("%s while unmarshaling %s", err, b)
  			continue
  		}
  
  		// Dispatch
  		r.d.dispatch(e)
  	}
  }
docs: // read reads from stdout