TryAdd correctly
This commit is contained in:
parent
16be33fc96
commit
a9889a6245
@ -23,7 +23,7 @@ type stream struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (sr *stream) write(msg drpc.Message) (err error) {
|
func (sr *stream) write(msg drpc.Message) (err error) {
|
||||||
return sr.queue.TryAdd(sr.stream.Context(), msg)
|
return sr.queue.TryAdd(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sr *stream) readLoop() error {
|
func (sr *stream) readLoop() error {
|
||||||
|
|||||||
@ -2,18 +2,19 @@ package streampool
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sort"
|
||||||
|
"sync"
|
||||||
|
"sync/atomic"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/anyproto/any-sync/net/peer"
|
"github.com/anyproto/any-sync/net/peer"
|
||||||
"github.com/anyproto/any-sync/net/rpc/rpctest"
|
"github.com/anyproto/any-sync/net/rpc/rpctest"
|
||||||
"github.com/anyproto/any-sync/net/streampool/testservice"
|
"github.com/anyproto/any-sync/net/streampool/testservice"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
"sort"
|
|
||||||
"storj.io/drpc"
|
"storj.io/drpc"
|
||||||
"sync"
|
|
||||||
"sync/atomic"
|
|
||||||
"testing"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var ctx = context.Background()
|
var ctx = context.Background()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user