Uneventful
    Preparing search index...
    • Run a restarting() callback for each value produced by a source.

      With each event that occurs, any previous callback run is cleaned up before the new one begins. (And the last run is cleaned up when the connection or its context ends.)

      This function is almost the exact opposite of each(), in that the stream is never paused (unless you do so manually via a throttle or inlet), and if the "loop body" (context the callback runs in) still has running activities when a new value arrives, forEach() restarts the task instead of dropping the arriving value.

      Type Parameters

      • T

      Parameters

      • src: Stream<T>

        An event source (i.e. a Source or Signal)

      • sink: Sink<T>

        A callback that receives values from the source

      • Optionalinlet: Inlet

        An optional throttle or inlet that will be used to pause the source (if it's a signal or supports backpressure)

      Returns Task

      a Task that can be used to detect the stream end/error, or ended to close it early.

    • When called without a source, return a callback suitable for use w/pipe(). e.g.:

      pipe(someSource, ..., forEach(v => { doSomething(v); }), optionalInlet));
      

      Type Parameters

      • T

      Parameters

      Returns (src: Stream<T>) => Task