JOB RUNNER
For What
When you have to many jobs to run, but there is a limit of async jobs, you can try this, this runner can easily make jobs run of the max async number.
How to use
Create runner
there are two method to create a runner, use a constractor:
let Runner = jobRunnerdefault;let runner = source: 123 step: 2 { return { } }
or use the create function:
let runner = jobRunner
Just run
When you created a runner, you can just call the run of the runner to start you jobs.
consolerunner
Options
source
this is the data source of you jobs, must be an array.
step
this is the number of you parallel jobs
runner
this is you job, for how to run
group
if the group is true, you jobs will run with group one by one. Otherwise, if one of the running jobs finished, there will fill another, until there was no left.
update options
you can update options of exist runners with the setOptions function
runner