Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
/ node-waitpid2 Public archive
forked from AvianFlu/node-waitpid

A node.js binding to the waitpid() syscall, for when you really just want to block and wait for a child process for a minute.

License

Notifications You must be signed in to change notification settings

joshiggins/node-waitpid2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-waitpid2

Originally forked from AvianFlu/node-waitpid changing the behaviour to be more like nature intended.

The waitpid syscall is used to wait for a process to change state.

For terminated child processes, waiting for them releases the resources associated with the child in the process table. If you don't do this, they could remain zombies for ever!

You should implement a blocking loop in your application in order to wait for a child process. You should do this asyncronously by passing WNOHANG as an option and using a timeout to call waitpid until the PID returned is 0 (no child process state changes left). Don't let the waitpid call block the whole thread.

Starting from version 2.0.0 fixed to use the latest node addon/v8 API.

building binary

If a binary is available it will be installed using node-pre-gyp. Binaries are hosted in this repository releases page. The process of building and uploading is as follows:

export NODE_PRE_GYP_GITHUB_TOKEN=<token>
./node_modules/node-pre-gyp/bin/node-pre-gyp configure
./node_modules/node-pre-gyp/bin/node-pre-gyp build
./node_modules/node-pre-gyp/bin/node-pre-gyp package
./node_modules/node-pre-gyp-github/bin/node-pre-gyp-github.js publish

About

A node.js binding to the waitpid() syscall, for when you really just want to block and wait for a child process for a minute.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 70.6%
  • JavaScript 15.6%
  • Python 13.8%