grpc-js-namedpipes
v0.1.8
Published
mainly designed to work with GrpcDotNetNamedPipes, enabling IPC between .NET and NodeJS apps
Downloads
17
Readme
grpc-js-namedpipes (project in progress)
A Node.js implementation of the protocol used by GrpcDotNetNamedPipes
Note: This is not an official gRPC implementation. Its mainly designed to work with GrpcDotNetNamedPipes for scenarios involving inter-process communication between .NET and Node.js over Named Pipes.
Features
- [x] NodeJs Server Implementation
- [x] Unary
- [x] Server Streaming
- [ ] Client Streaming
- [ ] Bidirectional Streaming
- [ ] NodeJs Client Implementation
- [ ] Unary
- [ ] Server Streaming
- [ ] Client Streaming
- [ ] Bidirectional Streaming
Usage
Node.js Server:
/**
* service implementation
*/
function sayHello(call, callback) {
var reply = new greeterMessages.HelloReply();
reply.setMessage('Hello ' + call.request.getName());
callback(null, reply);
}
var namedPipeServer = new NamedPipeServer("MY_NAMED_PIPE");
namedPipeServer.addService(greeterServices.GreeterService, { sayHello: sayHello })
namedPipeServer.start((error) => {
if (error === undefined) {
console.log("server listening")
}
})
.NET C# Client:
(see GrpcDotNetNamedPipes)
var channel = new GrpcDotNetNamedPipes.NamedPipeChannel(".", "MY_NAMED_PIPE");
var client = new Greeter.GreeterClient(channel);
var response = await client.SayHelloAsync(new HelloRequest { Name = "World" });
Console.WriteLine(response.Message); //prints "Hello World"