Skip to content

Commit 9d6dfbe

Browse files
committed
Channels that are open for reactive streams are Closeable
1 parent 5b5dc17 commit 9d6dfbe

File tree

3 files changed

+9
-6
lines changed
  • reactive
    • kotlinx-coroutines-reactive/src/main/kotlin/kotlinx/coroutines/experimental/reactive
    • kotlinx-coroutines-rx1/src/main/kotlin/kotlinx/coroutines/experimental/rx1
    • kotlinx-coroutines-rx2/src/main/kotlin/kotlinx/coroutines/experimental/rx2

3 files changed

+9
-6
lines changed

reactive/kotlinx-coroutines-reactive/src/main/kotlin/kotlinx/coroutines/experimental/reactive/Channel.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ import kotlinx.coroutines.experimental.channels.ReceiveChannel
2121
import org.reactivestreams.Publisher
2222
import org.reactivestreams.Subscriber
2323
import org.reactivestreams.Subscription
24+
import java.io.Closeable
2425
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater
2526

2627
/**
2728
* Return type for [Publisher.open] that can be used to [receive] elements from the
2829
* subscription and to manually [close] it.
2930
*/
30-
public interface SubscriptionReceiveChannel<out T> : ReceiveChannel<T> {
31+
public interface SubscriptionReceiveChannel<out T> : ReceiveChannel<T>, Closeable {
3132
/**
3233
* Closes this subscription channel.
3334
*/
34-
public fun close()
35+
public override fun close()
3536
}
3637

3738
/**

reactive/kotlinx-coroutines-rx1/src/main/kotlin/kotlinx/coroutines/experimental/rx1/RxChannel.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ import kotlinx.coroutines.experimental.channels.ReceiveChannel
2121
import rx.Observable
2222
import rx.Subscriber
2323
import rx.Subscription
24+
import java.io.Closeable
2425
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater
2526

2627
/**
2728
* Return type for [Observable.open] that can be used to [receive] elements from the
2829
* subscription and to manually [close] it.
2930
*/
30-
public interface SubscriptionReceiveChannel<out T> : ReceiveChannel<T> {
31+
public interface SubscriptionReceiveChannel<out T> : ReceiveChannel<T>, Closeable {
3132
/**
3233
* Closes this subscription channel.
3334
*/
34-
public fun close()
35+
public override fun close()
3536
}
3637

3738
/**

reactive/kotlinx-coroutines-rx2/src/main/kotlin/kotlinx/coroutines/experimental/rx2/RxChannel.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@ import io.reactivex.Observer
2222
import io.reactivex.disposables.Disposable
2323
import kotlinx.coroutines.experimental.channels.LinkedListChannel
2424
import kotlinx.coroutines.experimental.channels.ReceiveChannel
25+
import java.io.Closeable
2526

2627
/**
2728
* Return type for [Observable.open] that can be used to [receive] elements from the
2829
* subscription and to manually [close] it.
2930
*/
30-
public interface SubscriptionReceiveChannel<out T> : ReceiveChannel<T> {
31+
public interface SubscriptionReceiveChannel<out T> : ReceiveChannel<T>, Closeable {
3132
/**
3233
* Closes this subscription channel.
3334
*/
34-
public fun close()
35+
public override fun close()
3536
}
3637

3738
/**

0 commit comments

Comments
 (0)