Interface RowStreamConsumer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Callback that receives one query's result as a lazy
Stream of rows.
Used by QueryExecutor's streaming API to hand each query
statement's output to the caller without first materialising it into a list.
The executor owns the stream's lifecycle: the stream is opened immediately
before accept(java.lang.String, com.darkcollective.relix.symbol.Schema, java.util.stream.Stream<com.darkcollective.relix.processor.Row>) is invoked and closed immediately after it returns.
Consequently the consumer must finish reading the stream (or deliberately
stop) within the callback — it must not retain the rows
stream for later use, as it will be closed once accept returns. Rows
are pulled lazily, so any EvaluationException
raised during evaluation surfaces while the consumer is reading.
-
Method Summary
-
Method Details
-
accept
Consumes one query result.- Parameters:
label- the query's display label (relation name or"<expression N>")schema- the query's output schemarows- a lazy, single-use stream of the result rows, closed by the executor after this method returns
-