CacheExtractor implements Extractor, RewindableExtractor
FinalYes
Interfaces
- Extractor
- RewindableExtractor
- A rewindable extractor can be read more than once and yield the same rows each time, so a build-time pass may scan it before extraction without consuming it.
Methods
- __construct() : mixed
- extract() : Generator<Signal|null, void>
- Yields rows in batches. When the source is a BatchableExtractor a batch holds between 0 and that extractor's own batchSize() rows; the size is chosen by the extractor and MAY vary between batches. Consumers must not assume a minimum size, a constant size, or a non-empty batch.
- isRepeatable() : bool
- schema() : Schema
- Answers before extract() runs, so every batch it yields carries this shape. Takes no FlowContext: a source that needs the pipeline's context to describe itself has not moved the answer to bind time.
- withClearOnFinish() : self
- withFallbackExtractor() : self
- withSchema() : static
- Declares the shape every yielded batch must carry. A source that describes itself uses this instead of its own description, and values are cast to fit.
Methods
__construct()
public
__construct(string $id[, Cache|null $cache = null ]) : mixed
Parameters
- $id : string
- $cache : Cache|null = null
extract()
Yields rows in batches. When the source is a BatchableExtractor a batch holds between 0 and that extractor's own batchSize() rows; the size is chosen by the extractor and MAY vary between batches. Consumers must not assume a minimum size, a constant size, or a non-empty batch.
public
extract(FlowContext $context) : Generator<Signal|null, void>
Parameters
- $context : FlowContext
Return values
Generator<Signal|null, void>isRepeatable()
public
isRepeatable() : bool
Return values
boolschema()
Answers before extract() runs, so every batch it yields carries this shape. Takes no FlowContext: a source that needs the pipeline's context to describe itself has not moved the answer to bind time.
public
schema() : Schema
Return values
SchemawithClearOnFinish()
public
withClearOnFinish(bool $clear) : self
Parameters
- $clear : bool
Return values
selfwithFallbackExtractor()
public
withFallbackExtractor(Extractor $fallbackExtractor) : self
Parameters
- $fallbackExtractor : Extractor
Return values
selfwithSchema()
Declares the shape every yielded batch must carry. A source that describes itself uses this instead of its own description, and values are cast to fit.
public
withSchema(Schema $schema) : static
Parameters
- $schema : Schema