Step
dfhdl.internals.DiskCache.Step
abstract class Step[F, R](prevStepOrValue: Step[_, F] | (() => F), val hasGenFiles: Boolean)(otherDeps: => Any*) extends HasTypeName
A Step represents a cacheable computation step in a processing pipeline.
Each Step takes an input of type F, produces an output of type R, and caches the result based on a provided key. Steps can be chained together to form a pipeline where each step's output becomes the input to the next step.
Type parameters
- F
-
The input type for this step
- R
-
The output type for this step
Value parameters
- otherDeps
-
Additional dependencies for this step. These are used to determine if the cached result is still valid. To implement a Step, you must define:
run
: The actual computation that transforms F to RvalueToCacheStr
: How to serialize the result to a string for cachingcacheStrToValue
: How to deserialize the cached string back to the result type Optionally, you can override:logCachedRun
: Custom logging when a cached result is usedname
: The name used for cache files (defaults to the class name)
- prevStepOrValue
-
Either a previous Step that produces this step's input, or a function that provides the input
Attributes
- Graph
-
- Supertypes
Members list
In this article