GithubHelp home page GithubHelp logo

Clean up API about child-process HOT 3 OPEN

reactphp avatar reactphp commented on September 17, 2024
Clean up API

from child-process.

Comments (3)

loilo avatar loilo commented on September 17, 2024

Having a Promise-based helper as in (4) would be really useful.

A thing that should be baked in: Such an interface would offer the great opportunity of combining $promise->cancel() with $process->terminate() for really easy premature elimination of long-running processes.

from child-process.

 avatar commented on September 17, 2024

The only issue with 1) would be that there is no interface to type declare against. With #74 in mind an interface would possibly be required anyway, so the problem of mocking would be solved. To be clear, the "low level" API of directly using a Process should still exist, even when a launcher should be added.

However interfaces should exist so that the implementation can be arbitrarily replaced or customized, without introducing any dependencies or adaptions in code.

from child-process.

 avatar commented on September 17, 2024

I'd like to pick up 1) + 4) (Launcher concept), are there any specific helper methods that need to exist?

On my list currently:

  • launch ("builds" and starts the process)
  • buffer (launch + buffer stdout stream)
  • stream (should it only capture stdout?)

from child-process.

Related Issues (20)

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.