npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

out-of-proc-server

v0.0.7

Published

Out-of-proc-server (+ gRPC) provides interoperability between Node.js and .NET framework.

Downloads

4

Readme

Out-of-proc Server

Launch the gRPC server (or other type of server) on demand from the application.

Out-of-proc-server (+ gRPC) provides interoperability between Node.js JavaScript and .NET framework (and other languages you additionally implement the "out-of-proc-server" sequence).

It helps you to create the desktop applications based on distributed architecture.


Install

Node.js

Prerequirements

  • Node >= 10
$ npm install out-of-proc-server --save

.NET framework

Note: We have not published this to NuGet yet.

Prerequirements

  • .NET Core SDK >= 2.1

Install

  1. Download the source archive from https://github.com/shellyln/out-of-proc-server/archive/master.zip and extract it.
  2. Add src/dotnet/OutOfProcServer/OutOfProcServer.csproj to your solution.

Usage

See examples.


APIs

Node.js

launchServer

[Call from gRPC Client (Pipe Server)]
Launch the out-of-proc server process.

interface ServerContext {
    serverPipe: Server;
    conn: Socket;
    childProc: ChildProcess;
    shutdown: () => Promise<void>;
}

function launchServer(pipeName: string, command: string, args: string[], spawnOpts?: SpawnOptions): Promise<ServerContext>
  • returns : launched server process info.
    • promise will resolved when the server process connect to the pipe.
  • pipeName : name of the named pipe.
  • command : executable path.
  • args : command line arguments.
  • spawnOpts : options of child_process.spawn().

ServerContext#shutdown

[Call from gRPC Client (Pipe Server)]
Close the server pipe and end listening.

function shutdown(): Promise<void>
  • returns : none.
    • promise will resolved when the pipe is closed.

notifyReadyToClient

[Call from gRPC Server (Pipe Client)]
Notify to the client process that the out-of-proc server is ready to accept the requests.

function notifyReadyToClient(pipeName: string, handler: (event: string, eventArg?: any) => void): Socket;
  • returns : Socket of client pipe.
  • pipeName : name of the named pipe.
  • handler : event handler that called if 'close' or 'error' event is occured to the client pipe.

.NET framework

Launcher.LaunchServer

[Call from gRPC Client (Pipe Server)]
Launch the out-of-proc server process.

public static ServerContext LaunchServer(string pipeName, string command, string[] args);
  • returns : launched server process info.
  • pipeName : name of the named pipe.
  • command : executable path.
  • args : command line arguments.

ServerContext#Shutdown

[Call from gRPC Client (Pipe Server)]
Close the server pipe and end listening.

public ServerContext Shutdown();
  • returns : this object.

Notifier.NotifyReadyToClient

[Call from gRPC Server (Pipe Client)]
Notify to the client process that the out-of-proc server is ready to accept the requests.

public static Notifier NotifyReadyToClient(string pipeName);
  • returns : client pipe info.
  • pipeName : name of the named pipe.

Notifier#Wait

[Call from gRPC Server (Pipe Client)]
Wait forever until the client pipe is closed or broken.

public Notifier Wait();
  • returns : this object.

Notifier#Shutdown

[Call from gRPC Server (Pipe Client)]
Close the client pipe.

public Notifier Shutdown();
  • returns : this object.

Sequence diagram

Note: *nix environments use UNIX domain sockets instead of named pipes.

Graceful shutdown

Graceful

Unexpected shutdown

Unexpected


License

Apache-2.0

Copyright (c) 2019, Shellyl_N and Authors.

License of examples (./examples)

Apache-2.0

Copyright 2015 gRPC authors.
Copyright (c) 2019, Shellyl_N and Authors.