@metreeca/pipe
    Preparing search index...

    Function settle

    • Creates a sink that writes the deltas of a pipeline to the store.

      By default, each delta is committed on its own. If a run is interrupted, the resources already written stay in the store and the next run can carry on from there. A failed write is logged and counted as rejected: the resource keeps its previous state and the feed keeps running. A single failure costs only its own resource.

      A state rejected as invalid is handled differently, as it signals a broken run rather than a bad resource. If the states do not satisfy their shape, every write fails, and the run would still look clean while storing nothing. The error is therefore propagated, so the run fails visibly and can be retried once the states are fixed.

      With atomic, the whole feed is committed in a single transaction instead: if any write fails, the run fails and nothing is committed. This suits sources that cannot tolerate a partially applied run.

      The deltas are written to the store bound to the current execution.

      Parameters

      • options: { atomic?: boolean } = {}

        The options governing how the deltas are committed

        • Optional Readonlyatomic?: boolean

          Whether to commit all the deltas in a single transaction; defaults to false

      Returns Sink<Delta<Lazy<ResourceShape>>, Tally>

      A sink that writes a feed of deltas and resolves to a Tally of the changes made

      Error If no store is bound to the current execution

      RangeError While the feed is consumed, if the store rejects a state as invalid

      Error While the feed is consumed, with atomic, if any write fails; nothing is committed