Skip to content

Commit ab1ae7f

Browse files
committed
Deprecate ReceiveChannel.receiveOrNull
1 parent bc434c1 commit ab1ae7f

File tree

1 file changed

+5
-1
lines changed
  • common/kotlinx-coroutines-core-common/src/channels

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,13 @@ public interface ReceiveChannel<out E> {
206206
* This function can be used in [select] invocation with [onReceiveOrNull] clause.
207207
* Use [poll] to try receiving from this channel without waiting.
208208
*
209-
* **Note: This is an experimental api.** This function may be replaced with a better on in the future.
209+
* **Note: This is an obsolete api.**
210+
* This function will be replaced with `receiveOrClosed: ReceiveResult<E>` and
211+
* extension `suspend fun <E: Any> ReceiveChannel<E>.receiveOrNull(): E?`
210212
*/
211213
@ExperimentalCoroutinesApi
214+
@ObsoleteCoroutinesApi
215+
@Deprecated(level = DeprecationLevel.WARNING, message = "This method does not distinguish closed channel and null elements")
212216
public suspend fun receiveOrNull(): E?
213217

214218
/**

0 commit comments

Comments
 (0)