Class AsyncCappingHeads

java.lang.Object
org.ek9lang.compiler.phase7.generator.AsyncCappingHeads
All Implemented Interfaces:
BiFunction<List<EK9Parser.StreamPartContext>, List<StageState>, List<StageState.Counter>>

final class AsyncCappingHeads extends Object implements BiFunction<List<EK9Parser.StreamPartContext>, List<StageState>, List<StageState.Counter>>
THE heads that cap an async (StreamDemand, decision 15 d): those reached from the async through stages that pass EVERY item on - map, call, tee and another head - in pipeline order. Every task started then yields an item such a head counts, so a head N needs only N tasks and the async starts no more than that: the caller bounds what is SUBMITTED by these limits. A stage that can drop an item (filter, reject, uniq, skip, flatten - an element may flatten to nothing) or must see everything stops the scan; past it, which tasks yield usable items is unknown, so the window stays. Hold an instance.