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
job 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" (callback job) is still running when a new value
arrives, forEach() restarts the job instead of dropping the value.
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 job 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" (callback job) is still running when a new value arrives, forEach() restarts the job instead of dropping the value.