Skip to content

Clustering #2

@alexbeletsky

Description

@alexbeletsky

For me, what would make respawn even more nicer is not only support fork mode, but cluster mode as well. Something like,

var respawn = require('respawn');

var monitor = respawn(['node', 'server.js'], {
    env: {ENV_VAR:'test'},  
    cwd: '.',  
    mode: 'cluster',   // 'fork' or 'cluster' mode, 'fork' default
    instances: 2,      // int specifying number of cluster instances, 'max` default
    maxRestarts:10, 
    sleep:1000,
});

monitor.start(); // spawn and watch

I'm happy to contribute that feature if you think it's applicable and we can discuss some details :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions