import * as tsplus_module_1 from "@effect/core/stream/Channel/operations/failCause";
import * as tsplus_module_2 from "@effect/core/stream/Channel/operations/succeedNow";
import * as tsplus_module_3 from "@effect/core/stream/Channel/operations/readWithCause";
import * as tsplus_module_4 from "@effect/core/stream/Channel/operations/pipeTo";
/**
 * Returns a new channel which reads all the elements from upstream's output
 * channel and ignores them, then terminates with the upstream result value.
 *
 * @tsplus getter ets/Channel drain
 */

export function drain(self) {
  const drainer = tsplus_module_3.readWithCause(() => drainer, cause => tsplus_module_1.failCause(() => cause), tsplus_module_2.succeedNow);
  return tsplus_module_4.pipeTo_(self, () => drainer);
}
//# sourceMappingURL=drain.mjs.map