import * as tsplus_module_1 from "@effect/core/stream/Channel/operations/pipeToOrFail";
import * as tsplus_module_2 from "@effect/core/stream/Channel/operations/runDrain";
import { concreteSink } from "@effect/core/stream/Sink/operations/_internal/SinkInternal";
import { concreteStream } from "@effect/core/stream/Stream/operations/_internal/StreamInternal";
/**
 * Runs the sink on the stream to produce either the sink's result or an
 * error.
 *
 * @tsplus fluent ets/Stream run
 */

export function run_(self, sink, __tsplusTrace) {
  void 0;
  return tsplus_module_2.runDrain(tsplus_module_1.pipeToOrFail_(self.channel, () => {
    const sink0 = sink();
    void 0;
    return sink0.channel;
  }));
}
/**
 * Runs the sink on the stream to produce either the sink's result or an
 * error.
 *
 * @tsplus static ets/Stream/Aspects run
 */

export const run = (sink, __tsplusTrace) => self => run_(self, sink, __tsplusTrace);
//# sourceMappingURL=run.mjs.map