Git Product home page Git Product logo

stdconn's Introduction

StdConn

This is a simple library that runs a client executable (in the example, it uses go run), creates a net.Conn with the stdin/stdout on both sides so the controller process can send IPC messages

How to use

stdconn.go and worker/worker.go are the reusable/convenience parts . stdconn.go is the net.Conn implementation and worker.go is mainly just a helper to start up an arbitrary executable with arbitrary arguments, it also has helpers to send stop and kill signals.

hello/implementation.go contains an example RPC implementation. Note that the most basic implementation should have a function like Bye() to stop the client, as closing its connection when using this IPC mechanism does not stop the child process which will block unless it is explicitly killed, and using os.Signal requires adding this handling code. So they are there for defcon IV type situations mainly and if using signals is preferred.

hello/wrapper contains a set of wrappers that shortens the RPC call syntax. If asynchronous calling is required, the wrappers would mimic the calling pattern with a cancel function and function that returns the reply or error over a channel. Probably this could be automated somehow but I haven't got the need or time for that right now.

stdconn's People

Watchers

James Cloos avatar l0k1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.