code: func (p *MsgPipeRW) WriteMsg(msg Msg) error {
  	if atomic.LoadInt32(p.closed) == 0 {
  		consumed := make(chan struct{}, 1)
  		msg.Payload = &eofSignal{msg.Payload, msg.Size, consumed}
  		select {
  		case p.w <- msg:
  			if msg.Size > 0 {
  				// wait for payload read or discard
  				select {
  				case <-consumed:
  				case <-p.closing:
  				}
  			}
  			return nil
  		case <-p.closing:
  		}
  	}
  	return ErrPipeClosed
  }
docs: // WriteMsg sends a messsage on the pipe.
  // It blocks until the receiver has consumed the message payload.