Coder Social home page Coder Social logo

gulp-bg's People

Contributors

iblancasa avatar litek avatar rkusa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gulp-bg's Issues

How to stop the process

Hi!
I am using this plugin to run PhantomJS webdriver for my tests. I would like to kill the process when the tests are done. Is this possible?

Automatically kill background process launched by another background process whenever parent background process is relaunched.

Following is the script that I am using to live reload the gulpfile.js. default task will start a new background process gulp bootstrap which in turn starts another background process called node app/start.js. The initial run works as intended. But once I edit gulpfile.js it triggers a watch inside default and kills existing gulp bootstrap process and starts new gulp bootstrap. But the problem is previous instance of node app/start.js process is still running. Because previous instance of node server is not killed and it's still listens on the same port I get an error EADDRINUSE when I ever I edit gulpfile.js. Is there any way to automatically kill child process node app/start.js of gulp bootstrap when ever new gulp bootstrap process is launched ?

var gulp = require('gulp');
var watch = require('gulp-watch');
var bg = require('gulp-bg');

gulp.task('start_server', bg("node", "app/start.js"));

gulp.task('bootstrap', ['start_server'], function() {
    watch("app/**/*", function(){
        gulp.start('start_server');
    });
});

gulp.task('spawn_bootstrap', bg("gulp", "bootstrap"));

gulp.task('default', function(){
    watch('gulpfile.js', function() {
        gulp.start('spawn_bootstrap');
    });
    gulp.start('spawn_bootstrap');
});

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.