We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I really like this project and with multiple bars without use of cluster it works perfect.
But if I try to use it in clustermode i got weird. I think its related to the ProgressBar object references but not sure.
Has anyone an idea how this can be done?
I prepared a litte example to demonstrate the scenario:
runC() => does the progressbars for cluster mode which works not :/ runN() => does the progressbars without cluster mode which works
const cluster = require('cluster'), ProgressBar = require('ascii-progress'); const bars = {}; async function job(myNum) { const timer = setInterval( () => { bars[myNum].tick(); if (bars[myNum].completed) { clearInterval(timer); } }, 150); } function createBars(data) { for (let i = 0; i < data.length; i++) { bars[data[i]] = new ProgressBar({ schema: `${ data[i] } [:bar.gradient(green,magenta)] :percent`, total: data[i] }); } } async function runC() { const data = [10,20,30]; createBars(data); if (cluster.isMaster) { for (let i = 0; i < 3; i++) { cluster.fork({special_data: data.pop()}); } } else { job(process.env.special_data); } } async function runN() { const data = [10,20,30]; createBars(data); for (let i = 0; i < 3; i++) { job(data.pop()); } } // runC(); // runN();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I really like this project and with multiple bars without use of cluster it works perfect.
But if I try to use it in clustermode i got weird. I think its related to the ProgressBar object references but not sure.
Has anyone an idea how this can be done?
I prepared a litte example to demonstrate the scenario:
runC() => does the progressbars for cluster mode which works not :/
runN() => does the progressbars without cluster mode which works
The text was updated successfully, but these errors were encountered: