This section covers concurrent operations that allow multiple sinks to run simultaneously. These can be valuable for enhancing task performance when concurrent execution is desired.
Combining Results with Concurrent Zipping
To run two sinks concurrently and combine their results, use Sink.zip. This operation executes both sinks concurrently and combines their outcomes into a tuple.
Example (Running Two Sinks Concurrently and Combining Results)
Racing Sinks: First Completion Wins
The Sink.race operation allows multiple sinks to compete for completion. The first sink to finish provides the result.
Example (Racing Two Sinks to Capture the First Result)