Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7543237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:22:27+00:00 2026-05-30T08:22:27+00:00

I am messing around with https://github.com/nodejitsu/forever , and am wondering in general if and

  • 0

I am messing around with https://github.com/nodejitsu/forever, and am wondering in general if and how you send messages from one command line process to another.

On the web, you use HTTP to send requests back and forth. But I’ve never had to do that type of thing with the command line before. I know it probably has to do with ports and sockets, but not so sure where to start…

Here’s the basic setup:

You have a mainProcess.js and childProcess.js, and they are invoked independently from the command line. Somehow, mainProcess.js must run a callback whenever childProcess.js sends it a message.

./parent.js:

var forever       = require("forever");
var mainProcess   = forever.start(["node", "mainProcess.js"], {max: 1, silent: true});
mainProcess.on("stdout", function(data) {
  console.log(data.toString().trim());
});
mainProcess.on("stderr", function(data) {
  console.log(data.toString().trim());
});
forever.startServer(mainProcess);

./child.js:

var forever       = require("forever");
var childProcess  = forever.start(["node", "childProcess.js"], {max: 1, silent: true});
childProcess.on("stdout", function(data) {
  // *send to parent process*
});
forever.startServer(childProcess);

./childProcess.js

console.log("A Message from a child process!")

One way to do it is to parse log files, but that seems like it’d get messy quick. It seems like there’s some protocol out there that will allow me to send direct messages from one process to another the same way you would with HTTP to a url. How would you accomplish this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:22:28+00:00Added an answer on May 30, 2026 at 8:22 am

    Performing IPC in node.js can be accomplished in a number of ways. Built in, there is the child_process.fork() API: http://nodejs.org/docs/latest/api/child_processes.html#child_process.fork

    In forever, there is an option, .fork which will tell forever to use the child_process.fork() API instead of child_process.spawn():

    var child = forever.start('script-using-fork-api.js', {
      max: 1,
      fork: true,
      silent: true
    });
    

    If you’re looking for IPC mechanisms which go over the network checkout:

    • http://hook.io
    • http://github.com/nodejitsu/nssocket
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been messing around with Jquery's transform3d plugin, developed by heygrady (https://github.com/heygrady/transform3d). And
Messing around with 'extension functions' for the List module. (I spent quite a while
I am messing around with a toy interpreter in Java and I was considering
I was messing around with RhinoMocks this morning and couldn't run my tests because
I am messing around with Doctrine (version 1.0.3) to see if would make a
I'm messing around with some C code using floats, and I'm getting 1.#INF00, -1.#IND00
I've been messing around with the free Digital Mars Compiler at work (naughty I
I was messing around with my toolbars and menus in Visual Studio 08. I
I am currently messing around with some stuff for an idea for a site
I'm currently messing around with Rob Eisenberg's Caliburn framework. When looking at the documentation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.