sclass PlanInMotion extends DynamicObject { L doneSteps = synchroList(); L plannedSteps = synchroLinkedList(); volatile bool paused, cancelled; void add(A a) { plannedSteps.add(a); } IterableIterator master() { ret iteratorFromFunction(func -> A { paused || cancelled ? null : syncPopFirst(plannedSteps) }); } }