use Stream Sender
inline suspend fun <S : BaseStreamSender<*>, R> useStreamSender(sender: S, block: suspend S.() -> R): Result<R>
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.
Any exceptions thrown within block will be caught and returned in the result.
Return
A successful Result object containing the return value of block, or a failure if any exceptions were thrown.