merging reader

This commit is contained in:
Darien Raymond committed 2017-03-27 11:12:34 +02:00
1 parent eab2f1effc
commit cb0e29ccdb
4 files changed
+54 -7

No files matched your search

+1 -4
View File
@@ -2,7 +2,6 @@ package ray
import (
"context"
"errors"
"io"
"time"
@@ -13,8 +12,6 @@ const (
bufferSize = 512
)
var ErrReadTimeout = errors.New("Ray: timeout.")
// NewRay creates a new Ray for direct traffic transport.
func NewRay(ctx context.Context) Ray {
return &directRay{
@@ -101,7 +98,7 @@ func (v *Stream) ReadTimeout(timeout time.Duration) (*buf.Buffer, error) {
case <-v.err:
return nil, io.ErrClosedPipe
case <-time.After(timeout):
return nil, ErrReadTimeout
return nil, buf.ErrReadTimeout
}
}
}