Simple async batch with concurrency control and progress reporting.\hypertarget{md_sfcode_node_modules_batch_Readme_autotoc_md3911}{}\doxysection{Installation}\label{md_sfcode_node_modules_batch_Readme_autotoc_md3911}

\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install batch }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_batch_Readme_autotoc_md3912}{}\doxysection{API}\label{md_sfcode_node_modules_batch_Readme_autotoc_md3912}

\begin{DoxyCode}{0}
\DoxyCodeLine{var Batch = require('batch')}
\DoxyCodeLine{  , batch = new Batch;}
\DoxyCodeLine{}
\DoxyCodeLine{batch.concurrency(4);}
\DoxyCodeLine{}
\DoxyCodeLine{ids.forEach(function(id)\{}
\DoxyCodeLine{  batch.push(function(done)\{}
\DoxyCodeLine{    User.get(id, done);}
\DoxyCodeLine{  \});}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{batch.on('progress', function(e)\{}
\DoxyCodeLine{}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{batch.end(function(err, users)\{}
\DoxyCodeLine{}
\DoxyCodeLine{\}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_batch_Readme_autotoc_md3913}{}\doxysubsection{Progress events}\label{md_sfcode_node_modules_batch_Readme_autotoc_md3913}
Contain the \char`\"{}job\char`\"{} index, response value, duration information, and completion data.


\begin{DoxyCode}{0}
\DoxyCodeLine{\{ index: 1,}
\DoxyCodeLine{  value: 'bar',}
\DoxyCodeLine{  pending: 2,}
\DoxyCodeLine{  total: 3,}
\DoxyCodeLine{  complete: 2,}
\DoxyCodeLine{  percent: 66,}
\DoxyCodeLine{  start: Thu Oct 04 2012 12:25:53 GMT-\/0700 (PDT),}
\DoxyCodeLine{  end: Thu Oct 04 2012 12:25:53 GMT-\/0700 (PDT),}
\DoxyCodeLine{  duration: 0 \} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_batch_Readme_autotoc_md3914}{}\doxysection{License}\label{md_sfcode_node_modules_batch_Readme_autotoc_md3914}
\mbox{[}MIT\mbox{]}(LICENSE) 