next method

void next(
  1. void worker(
    1. T nextObj
    )
)

Implementation

void next(void Function(T nextObj) worker)
{
  if (list.isEmpty)
    throw 'No Element';

  T ret = list[cur];
  cur++;
  if (cur >= list.length)
    cur = 0;

  //DevConsole.printIfDebug('roundrobin: next: $ret');
  worker(ret);
}