Metreeca MIME
    Preparing search index...

    Function validate

    • Creates a value validation task.

      The task keeps the values a validator accepts and drops the ones it rejects, so that downstream tasks work only on values known to meet the expected constraints.

      Note

      • Incremental: each accepted value is emitted as soon as it is drawn, so endless sources are processed for as long as the feed is consumed.
      • Streaming: values are validated one at a time and none is retained, so memory use doesn't grow with the length of the feed.
      • Stateless: each value is validated independently, so the result doesn't depend on how the feed is split across nested feeds or runs.
      Warning

      Rejected values are dropped and logged as warnings, together with the trace of their violations, and the feed runs to completion.

      Type Parameters

      • V

        The type of the validated values

      Parameters

      • validator: Validator<V>

        The validator applied to each value, reporting the trace of the violations it finds, or nothing if the value meets every constraint

      Returns Task<V>

      A task keeping the values accepted by validator

      Error While the feed is consumed, if the source feed fails or validator throws