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.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(List<EK9Parser.StreamPartContext> postAsyncStages, List<StageState> postAsyncStates) The heads capping the async.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThen
-
Constructor Details
-
AsyncCappingHeads
AsyncCappingHeads()
-
-
Method Details
-
apply
public List<StageState.Counter> apply(List<EK9Parser.StreamPartContext> postAsyncStages, List<StageState> postAsyncStates) The heads capping the async.- Specified by:
applyin interfaceBiFunction<List<EK9Parser.StreamPartContext>, List<StageState>, List<StageState.Counter>>- Parameters:
postAsyncStages- the stages straight after the asyncpostAsyncStates- their states, index for index
-