
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
child_process
pool implementation suporting:
var ChildPool = require('./child-pool');
ChildPool.isBackground(true);
var worker = new ChildPool(__dirname + '/child-worker', options);
worker.send({foo: 'bar'}, function() {
});
Options:
workers
: Number of workers that might be spawned. Defaults to # CPUs.keepAlive
: Time duration in ms to keep idle workers alive. Defaults to 500ms.Queues message
for the worker, calling callback
upon competion.
callback
will only be called once per message cycle. If the client sends out of band messages they will trigger an error
event on the pool instance and may be handled as appropriate there.
Broadcasts message
to all live workers immediately.
As there is no callback associated with this event, workers receiving this message should not send return messages. Those that do will cause an error
event on the pool instance.
A global worker
object is declared within the worker context. This exposes 3 process.send
wrappers that simplify data respones.
process.on('message', function(message) {
worker.data({foo: 'bar'});
});
Send a data message to the parent.
Send a non-fatal error message to the parent. This may be an Error
or string instance. In the later case the stack trace of the call will be associated with the message.
Send a fatal error message to the parent. This may be an Error
or string instance. In the later case the stack trace of the call will be associated with the message. The parent will terminate the worker after receiving this message.
Undermost circumstances, the library will not spawn more than the number of CPUs across the entire node instance. The exceptions are:
ChildPool.isBackground
has been called with a truthy value
Forces the library to not spawn more than #CPUs - 1. To ensure that there is a process open for interactive processes.
When there is only one CPU core
The library will still spawn two workers.
The global worker limit constrains any values that might have been passed in the pool initialization options.
FAQs
child_process pool implementation
The npm package child-pool receives a total of 1 weekly downloads. As such, child-pool popularity was classified as not popular.
We found that child-pool demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.