Use client.Call for non streaming requests

This commit is contained in:
Asim Aslam
2019-08-16 17:24:17 +01:00
parent 0b0eee41d0
commit 4495ca3839
4 changed files with 23 additions and 22 deletions

View File

@@ -118,7 +118,7 @@ func (r *rpcClient) call(ctx context.Context, node *registry.Node, req Request,
codec: codec,
closed: make(chan bool),
release: func(err error) { r.pool.Release(c, err) },
sendEOS: opts.SendEOS,
sendEOS: false,
}
// close the stream on exiting this function
defer stream.Close()
@@ -244,7 +244,7 @@ func (r *rpcClient) stream(ctx context.Context, node *registry.Node, req Request
// used to close the stream
closed: make(chan bool),
// signal the end of stream,
sendEOS: opts.SendEOS,
sendEOS: true,
// release func
release: func(err error) { r.pool.Release(c, err) },
}