mirror of
https://github.com/go-micro/go-micro.git
synced 2025-11-29 21:47:44 +02:00
Channel rather than mutex to check is closed
This commit is contained in:
@@ -136,9 +136,12 @@ func (r *rpcClient) stream(ctx context.Context, address string, req Request) (St
|
||||
return nil, errors.InternalServerError("go.micro.client", fmt.Sprintf("Error sending request: %v", err))
|
||||
}
|
||||
|
||||
var once sync.Once
|
||||
stream := &rpcStream{
|
||||
context: ctx,
|
||||
request: req,
|
||||
once: once,
|
||||
closed: make(chan bool),
|
||||
codec: newRpcPlusCodec(msg, c, cf),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user