-
Notifications
You must be signed in to change notification settings - Fork 678
Closed
Labels
Description
// ServiceA - proto
const proto = grpc.load({
root: protoDir,
file: 'serviceA.proto'
});
// ServiceB - proto
const proto = grpc.load({
root: protoDir,
file: 'serviceB.proto'
});
let clientA = new ddl_proto.com.mypackage.serviceA(common_url, grpc.credentials.createInsecure());
clientA.functionOne({
options: JSON.stringify(user_options)
}, (error, response) => {
console.log(response)
})
let clientB = new ddl_proto.com.mypackage.serviceB(common_url, grpc.credentials.createInsecure());
clientB.functionTwo({
options: JSON.stringify(user_options)
}, (error, response) => {
console.log(response)
})
If ServiceA
and ServiceB
are served by same server, is there any way by which i can reuse the client object ?
Can i do something like this :
let commonClient = new grpc.Client(common_url, grpc.credentials.createInsecure());
commonClient.ServiceA.functionOne();
commonClient.ServiceB.functionTwo();