grpc-caller
grpc-caller copied to clipboard
Cannot create twice a client that uses stream
I have some code which is using the static way to promisify the gRPC calls. However if I do them twice in a raw the second time, the streaming APIs don't work. After debugging I found that the grpc Client object is being modified in such a way that it drops some of the fields of the original service object.
Simply try:
const services = require('./static/helloworld_grpc_pb');
var client = caller('localhost:50051', services.GreeterClient); // Client works for both normal and streaming gRPC calls.
client = caller('localhost:50051', services.GreeterClient);yar // Client works for normal gRPC calls but not for streaming.
Where GreeterClient has some APIs using streams.
Having this issue as well.
Hello, can you please provide a reproducible code example. Additionally can you try the req_res
branch of #11 and see if the problem still persists. Note that now you have to explicitly add grpc
dependency in your package.json
. Thanks!