I’m playing around with node.js, trying to re-write a particularly poorly designed part of my production system at work. So far, so good, I use rabbitmq for messaging, and my node.js part of the system runs ghostscript command line tool to convert tiff files to pdf. Obviously I need to make sure I’m not running more than some fixed amount of conversions at a time. What would be the best way to do this with node? I understand that maybe node.js isn’t really about running heavy disk IO stuff, but I’m having too much fun with it to quit.
I was considering just using a blocking call to execute command line utilities but the thing is that some messages don’t require this conversion and there’s no need to delay their processing.
I’m playing around with node.js, trying to re-write a particularly poorly designed part of
Share
[Update] node-batches seems more appropriate.
I think you need something like forEachLimit (the following snippet was extracted from the async library)
Usage: