Get rid of calculateJobsCount(), which was used to predict how many jobs are expected to launch.
The Problem
The prediction had to be always correct, lest you risk not all results being reported. This introduced unnecessary brittleness of ensuring that this business logic was accurate in two places: to predict and to actually launch this very amount.
The Solution
Create all StartOptions first, which represents the source of truth of how many jobs will be launched. Then queue them all up.
The reason why we can't simply do a go startJob() as we go, is because the jobs would be launching out of order, interfering with our launch order feature.
Description
Get rid of
calculateJobsCount()
, which was used to predict how many jobs are expected to launch.The Problem
The prediction had to be always correct, lest you risk not all results being reported. This introduced unnecessary brittleness of ensuring that this business logic was accurate in two places: to predict and to actually launch this very amount.
The Solution
Create all
StartOptions
first, which represents the source of truth of how many jobs will be launched. Then queue them all up.The reason why we can't simply do a
go startJob()
as we go, is because the jobs would be launching out of order, interfering with our launch order feature.