grpc-js-namedpipes
TypeScript icon, indicating that this package has built-in type declarations

0.1.8 • Public • Published

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"
            

Package Sidebar

Install

npm i grpc-js-namedpipes

Weekly Downloads

52

Version

0.1.8

License

MIT

Unpacked Size

401 kB

Total Files

39

Last publish

Collaborators

  • yassinmi