File tree 2 files changed +8
-0
lines changed
core/kotlinx-coroutines-io/src/main/kotlin/kotlinx/coroutines/experimental/io
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,9 @@ internal class ByteBufferChannel(
93
93
override var totalBytesWritten: Long = 0L
94
94
private set
95
95
96
+ override val closedCause: Throwable ?
97
+ get() = closed?.cause
98
+
96
99
override fun close (cause : Throwable ? ): Boolean {
97
100
if (closed != null ) return false
98
101
val newClosed = if (cause == null ) ClosedElement .EmptyCause else ClosedElement (cause)
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ public interface ByteWriteChannel {
43
43
*/
44
44
public val totalBytesWritten: Long
45
45
46
+ /* *
47
+ * An closure cause exception or `null` if closed successfully or not yet closed
48
+ */
49
+ public val closedCause: Throwable ?
50
+
46
51
/* *
47
52
* Writes as much as possible and only suspends if buffer is full
48
53
*/
You can’t perform that action at this time.
0 commit comments