mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-11 18:20:28 +09:00
Some streampool changes and incoming guard
This commit is contained in:
parent
a05700e0f6
commit
bcfe02122c
10 changed files with 74 additions and 131 deletions
|
@ -2,7 +2,6 @@ package synctest
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"storj.io/drpc"
|
||||
|
||||
|
@ -16,14 +15,11 @@ type CounterRequestSender struct {
|
|||
|
||||
func (c *CounterRequestSender) SendStreamRequest(ctx context.Context, rq syncdeps.Request, receive func(stream drpc.Stream) error) (err error) {
|
||||
peerId := rq.PeerId()
|
||||
fmt.Println("getting peer", peerId, rq.PeerId(), rq.ObjectId())
|
||||
pr, err := c.peerProvider.GetPeer(peerId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println("sending stream request with peer", pr.Id(), rq.PeerId(), rq.ObjectId())
|
||||
return pr.DoDrpc(ctx, func(conn drpc.Conn) error {
|
||||
fmt.Println("after connection", pr.Id(), rq.PeerId(), rq.ObjectId())
|
||||
cl := synctestproto.NewDRPCCounterSyncClient(conn)
|
||||
stream, err := cl.CounterStreamRequest(ctx, rq.Proto().(*synctestproto.CounterRequest))
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue