Browse Source

signal when read

Darien Raymond 7 years ago
parent
commit
b4ff4c7e75
2 changed files with 2 additions and 0 deletions
  1. 1 0
      transport/pipe/impl.go
  2. 1 0
      transport/pipe/pipe.go

+ 1 - 0
transport/pipe/impl.go

@@ -62,6 +62,7 @@ func (p *pipe) ReadMultiBuffer() (buf.MultiBuffer, error) {
 	for {
 		data, err := p.readMultiBufferInternal()
 		if data != nil || err != nil {
+			p.writeSignal.Signal()
 			return data, err
 		}
 

+ 1 - 0
transport/pipe/pipe.go

@@ -19,6 +19,7 @@ func WithSizeLimit(limit int32) Option {
 	}
 }
 
+// New creates a new Reader and Writer that connects to each other.
 func New(opts ...Option) (*Reader, *Writer) {
 	p := &pipe{
 		limit:       defaultLimit,