import * as tsplus_module_1 from "@tsplus/stdlib/data/Either/merge";
import * as tsplus_module_2 from "@effect/core/stream/Sink/operations/raceBoth";
import * as tsplus_module_3 from "@effect/core/stream/Sink/operations/map";
/**
 * Runs both sinks in parallel on the input, , returning the result or the
 * error from the one that finishes first.
 *
 * @tsplus fluent ets/Sink race
 */

export function race_(self, that, __tsplusTrace) {
  return tsplus_module_3.map_(tsplus_module_2.raceBoth_(self, that), either => tsplus_module_1.merge(either), __tsplusTrace);
}
/**
 * Runs both sinks in parallel on the input, , returning the result or the
 * error from the one that finishes first.
 *
 * @tsplus static ets/Sink/Aspects race
 */

export const race = (that, __tsplusTrace) => self => race_(self, that, __tsplusTrace);
//# sourceMappingURL=race.mjs.map