Skip to content

Commit 0c6f16b

Browse files
authored
Deprecate for removal redundant Delay method (#2979)
1 parent 80af499 commit 0c6f16b

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

kotlinx-coroutines-core/common/src/Delay.kt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,12 @@ import kotlin.time.*
1919
*/
2020
@InternalCoroutinesApi
2121
public interface Delay {
22-
/**
23-
* Delays coroutine for a given time without blocking a thread and resumes it after a specified time.
24-
*
25-
* This suspending function is cancellable.
26-
* If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting, this function
27-
* immediately resumes with [CancellationException].
28-
* There is a **prompt cancellation guarantee**. If the job was cancelled while this function was
29-
* suspended, it will not resume successfully. See [suspendCancellableCoroutine] documentation for low-level details.
30-
*/
22+
23+
/** @suppress **/
24+
@Deprecated(
25+
message = "Deprecated without replacement as an internal method never intended for public use",
26+
level = DeprecationLevel.ERROR
27+
) // Error since 1.6.0
3128
public suspend fun delay(time: Long) {
3229
if (time <= 0) return // don't delay
3330
return suspendCancellableCoroutine { scheduleResumeAfterDelay(time, it) }

ui/kotlinx-coroutines-javafx/src/JavaFxDispatcher.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import javafx.event.*
1010
import javafx.util.*
1111
import kotlinx.coroutines.*
1212
import kotlinx.coroutines.internal.*
13-
import kotlinx.coroutines.javafx.JavaFx.delay
1413
import java.lang.UnsupportedOperationException
1514
import java.lang.reflect.*
1615
import java.util.concurrent.*

0 commit comments

Comments
 (0)