iammerrick / grunt-parallel

Speed up your build by running commands and tasks in parallel!
MIT License
170 stars 24 forks source link

feature: add option to limit number of parallel tasks. #27

Closed cgc closed 7 years ago

cgc commented 9 years ago

tested by running grunt parallel:grunt with this diff:

diff --git a/Gruntfile.js b/Gruntfile.js
index 6f7d872..ce92b59 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -5,7 +5,7 @@ module.exports = function(grunt) {
   });

   grunt.registerTask('block', function() {
-    var ms = 1000;
+    var ms = 3000;
     var start = +(new Date());
     while (new Date() - start < ms);
     grunt.log.write('Blocking finished.');
@@ -42,9 +42,10 @@ module.exports = function(grunt) {
       },
       grunt: {
         options: {
+          concurrency: 3,
           grunt: true
         },
-        tasks: ['fast', 'block', 'fast']
+        tasks: ['block', 'block', 'block', 'block', 'block', 'block', 'block', 'block', 'block']
       },
       stream: {
         options: {
cgc commented 9 years ago

ping @iammerrick

iammerrick commented 9 years ago

Can you bump the version number to 0.5 and then I'll merge and publish.

cgc commented 9 years ago

@iammerrick rebased, added a test, bumped the version. appreciate you looking at this change, it's been a key part of "fast deployment with 100% uptime" on my projects!

cgc commented 9 years ago

@iammerrick let me know if you'd like other changes added!

hhaidar commented 9 years ago

+1

cgc commented 9 years ago

@iammerrick let me know if there's anything I can do to help get this merged!

stephen commented 9 years ago

+1

oliversong commented 9 years ago

+1

sebadom commented 7 years ago

i guess this was dropped out? @cgc this would be nice

cgc commented 7 years ago

@sebadom this wasn't merged in two years, so I'm just going to close the request. Feel free to take these commits and open a new PR!