-
public final class BaseStreamSenderKt
-
-
Method Summary
Modifier and Type Method Description final static <S extends BaseStreamSender<?>, R extends Any> Result<R>useStreamSender(S sender, SuspendFunction1<S, R> block)Runs block with sender, then ensures sender is closed afterwards if it is still open. -
-
Method Detail
-
useStreamSender
@CheckResult() final static <S extends BaseStreamSender<?>, R extends Any> Result<R> useStreamSender(S sender, SuspendFunction1<S, R> block)
Runs block with sender, then ensures sender is closed afterwards if it is still open.
On success, block should still attempt to close sender when the stream is finished normally. If it is left open, any exceptions thrown by sender.close will be ignored.
-
-
-
-