@@ -29,7 +29,7 @@ type streamClient[Req, Resp any] interface {
29
29
30
30
// streamConstructor creates a new gRPC stream client over the provided client
31
31
// connection, using the provided call options.
32
- type streamConstructor [Req , Resp , Conn any ] func (
32
+ type streamConstructor [Req , Resp any , Conn rpcConn ] func (
33
33
context.Context , Conn ,
34
34
) (streamClient [Req , Resp ], error )
35
35
@@ -67,7 +67,7 @@ const defaultPooledStreamIdleTimeout = 10 * time.Second
67
67
//
68
68
// A pooledStream must only be returned to the pool for reuse after a successful
69
69
// Send call. If the Send call fails, the pooledStream must not be reused.
70
- type pooledStream [Req , Resp any , Conn comparable ] struct {
70
+ type pooledStream [Req , Resp any , Conn rpcConn ] struct {
71
71
pool * streamPool [Req , Resp , Conn ]
72
72
stream streamClient [Req , Resp ]
73
73
streamCtx context.Context
@@ -77,7 +77,7 @@ type pooledStream[Req, Resp any, Conn comparable] struct {
77
77
respC chan result [Resp ]
78
78
}
79
79
80
- func newPooledStream [Req , Resp any , Conn comparable ](
80
+ func newPooledStream [Req , Resp any , Conn rpcConn ](
81
81
pool * streamPool [Req , Resp , Conn ],
82
82
stream streamClient [Req , Resp ],
83
83
streamCtx context.Context ,
@@ -190,7 +190,7 @@ func (s *pooledStream[Req, Resp, Conn]) Send(ctx context.Context, req Req) (Resp
190
190
// manner that mimics unary RPC invocation. Pooling these streams allows for
191
191
// reuse of gRPC resources across calls, as opposed to native unary RPCs, which
192
192
// create a new stream and throw it away for each request (see grpc.invoke).
193
- type streamPool [Req , Resp any , Conn comparable ] struct {
193
+ type streamPool [Req , Resp any , Conn rpcConn ] struct {
194
194
stopper * stop.Stopper
195
195
idleTimeout time.Duration
196
196
newStream streamConstructor [Req , Resp , Conn ]
@@ -206,7 +206,7 @@ type streamPool[Req, Resp any, Conn comparable] struct {
206
206
}
207
207
}
208
208
209
- func makeStreamPool [Req , Resp any , Conn comparable ](
209
+ func makeStreamPool [Req , Resp any , Conn rpcConn ](
210
210
stopper * stop.Stopper , newStream streamConstructor [Req , Resp , Conn ],
211
211
) streamPool [Req , Resp , Conn ] {
212
212
return streamPool [Req , Resp , Conn ]{
0 commit comments