Skip to content

Commit eb963e8

Browse files
authored
Remove deprecated SendChannel.isFull (#2613)
1 parent 98532c9 commit eb963e8

File tree

10 files changed

+2
-21
lines changed

10 files changed

+2
-21
lines changed

kotlinx-coroutines-core/api/kotlinx-coroutines-core.api

-2
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,6 @@ public final class kotlinx/coroutines/channels/ConflatedBroadcastChannel : kotli
802802
public final fun getValueOrNull ()Ljava/lang/Object;
803803
public fun invokeOnClose (Lkotlin/jvm/functions/Function1;)V
804804
public fun isClosedForSend ()Z
805-
public fun isFull ()Z
806805
public fun offer (Ljava/lang/Object;)Z
807806
public fun openSubscription ()Lkotlinx/coroutines/channels/ReceiveChannel;
808807
public fun send (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
@@ -857,7 +856,6 @@ public abstract interface class kotlinx/coroutines/channels/SendChannel {
857856
public abstract fun getOnSend ()Lkotlinx/coroutines/selects/SelectClause2;
858857
public abstract fun invokeOnClose (Lkotlin/jvm/functions/Function1;)V
859858
public abstract fun isClosedForSend ()Z
860-
public abstract fun isFull ()Z
861859
public abstract fun offer (Ljava/lang/Object;)Z
862860
public abstract fun send (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
863861
public abstract fun trySend-JP2dKIU (Ljava/lang/Object;)Ljava/lang/Object;

kotlinx-coroutines-core/common/src/channels/AbstractChannel.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ internal abstract class AbstractSendChannel<E>(
127127
// ------ SendChannel ------
128128

129129
public final override val isClosedForSend: Boolean get() = closedForSend != null
130-
public override val isFull: Boolean get() = isFullImpl
131-
protected val isFullImpl: Boolean get() = queue.nextNode !is ReceiveOrClosed<*> && isBufferFull
130+
private val isFullImpl: Boolean get() = queue.nextNode !is ReceiveOrClosed<*> && isBufferFull
132131

133132
public final override suspend fun send(element: E) {
134133
// fast path -- try offer non-blocking

kotlinx-coroutines-core/common/src/channels/ArrayChannel.kt

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ internal open class ArrayChannel<E>(
4949
protected final override val isBufferAlwaysFull: Boolean get() = false
5050
protected final override val isBufferFull: Boolean get() = size.value == capacity && onBufferOverflow == BufferOverflow.SUSPEND
5151

52-
override val isFull: Boolean get() = lock.withLock { isFullImpl }
5352
override val isEmpty: Boolean get() = lock.withLock { isEmptyImpl }
5453
override val isClosedForReceive: Boolean get() = lock.withLock { super.isClosedForReceive }
5554

kotlinx-coroutines-core/common/src/channels/Channel.kt

-10
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ public interface SendChannel<in E> {
3131
@ExperimentalCoroutinesApi
3232
public val isClosedForSend: Boolean
3333

34-
/**
35-
* Returns `true` if the channel is full (out of capacity), which means that an attempt to [send] will suspend.
36-
* This function returns `false` if the channel [is closed for `send`][isClosedForSend].
37-
*
38-
* @suppress **Will be removed in next releases, no replacement.**
39-
*/
40-
@ExperimentalCoroutinesApi
41-
@Deprecated(level = DeprecationLevel.ERROR, message = "Will be removed in next releases without replacement")
42-
public val isFull: Boolean
43-
4434
/**
4535
* Sends the specified [element] to this channel, suspending the caller while the buffer of this channel is full
4636
* or if it does not exist, or throws an exception if the channel [is closed for `send`][isClosedForSend] (see [close] for details).

kotlinx-coroutines-core/common/src/channels/ConflatedBroadcastChannel.kt

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public class ConflatedBroadcastChannel<E>() : BroadcastChannel<E> {
9494
}
9595

9696
public override val isClosedForSend: Boolean get() = _state.value is Closed
97-
public override val isFull: Boolean get() = false
9897

9998
@Suppress("UNCHECKED_CAST")
10099
public override fun openSubscription(): ReceiveChannel<E> {

kotlinx-coroutines-core/jvm/src/channels/Channels.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ package kotlinx.coroutines.channels
1010
import kotlinx.coroutines.*
1111

1212
/**
13-
* Adds [element] into to this channel, **blocking** the caller while this channel [Channel.isFull],
13+
* Adds [element] into to this channel, **blocking** the caller while this channel is full,
1414
* or throws exception if the channel [Channel.isClosedForSend] (see [Channel.close] for details).
1515
*
1616
* This is a way to call [Channel.send] method inside a blocking code using [runBlocking],

reactive/kotlinx-coroutines-reactive/api/kotlinx-coroutines-reactive.api

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public final class kotlinx/coroutines/reactive/PublisherCoroutine : kotlinx/coro
5757
public fun invokeOnClose (Lkotlin/jvm/functions/Function1;)Ljava/lang/Void;
5858
public synthetic fun invokeOnClose (Lkotlin/jvm/functions/Function1;)V
5959
public fun isClosedForSend ()Z
60-
public fun isFull ()Z
6160
public fun offer (Ljava/lang/Object;)Z
6261
public synthetic fun onCompleted (Ljava/lang/Object;)V
6362
public fun registerSelectClause2 (Lkotlinx/coroutines/selects/SelectInstance;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)V

reactive/kotlinx-coroutines-reactive/src/Publish.kt

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public class PublisherCoroutine<in T>(
9191
private var cancelled = false // true when Subscription.cancel() is invoked
9292

9393
override val isClosedForSend: Boolean get() = isCompleted
94-
override val isFull: Boolean = mutex.isLocked
9594
override fun close(cause: Throwable?): Boolean = cancelCoroutine(cause)
9695
override fun invokeOnClose(handler: (Throwable?) -> Unit): Nothing =
9796
throw UnsupportedOperationException("PublisherCoroutine doesn't support invokeOnClose")

reactive/kotlinx-coroutines-rx2/src/RxObservable.kt

-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ private class RxObservableCoroutine<T : Any>(
8080
private val _signal = atomic(OPEN)
8181

8282
override val isClosedForSend: Boolean get() = isCompleted
83-
override val isFull: Boolean = mutex.isLocked
8483
override fun close(cause: Throwable?): Boolean = cancelCoroutine(cause)
8584
override fun invokeOnClose(handler: (Throwable?) -> Unit) =
8685
throw UnsupportedOperationException("RxObservableCoroutine doesn't support invokeOnClose")

reactive/kotlinx-coroutines-rx3/src/RxObservable.kt

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ private class RxObservableCoroutine<T: Any>(
6666
private val _signal = atomic(OPEN)
6767

6868
override val isClosedForSend: Boolean get() = isCompleted
69-
override val isFull: Boolean = mutex.isLocked
7069
override fun close(cause: Throwable?): Boolean = cancelCoroutine(cause)
7170
override fun invokeOnClose(handler: (Throwable?) -> Unit) =
7271
throw UnsupportedOperationException("RxObservableCoroutine doesn't support invokeOnClose")

0 commit comments

Comments
 (0)