I am trying to understand the custom iterators topic Custom Iterators
But there is a thing which I don't get.
There is a next()
method which divides the query size into smaller ones, am I right? In the example below there would be several batches containing 8 records.
global Account next(){
// 8 is an arbitrary
// constant in this example
// that represents the
// maximum size of the list.
if(i == 8){return null;}
i++;
return accs[i-1];
}
How is that possible to calculate how many records I want to have in one batch?