Package 

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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.