Skip to content

Commit

Permalink
Deprecate for removal redundant Delay method
Browse files Browse the repository at this point in the history
  • Loading branch information
qwwdfsad committed Oct 20, 2021
1 parent 8d1ee7d commit 6c6b717
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
15 changes: 6 additions & 9 deletions kotlinx-coroutines-core/common/src/Delay.kt
Expand Up @@ -19,15 +19,12 @@ import kotlin.time.*
*/
@InternalCoroutinesApi
public interface Delay {
/**
* Delays coroutine for a given time without blocking a thread and resumes it after a specified time.
*
* This suspending function is cancellable.
* If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting, this function
* immediately resumes with [CancellationException].
* There is a **prompt cancellation guarantee**. If the job was cancelled while this function was
* suspended, it will not resume successfully. See [suspendCancellableCoroutine] documentation for low-level details.
*/

/** @suppress **/
@Deprecated(
message = "Deprecated without replacement as an internal method never intended for public use",
level = DeprecationLevel.ERROR
) // Error since 1.6.0
public suspend fun delay(time: Long) {
if (time <= 0) return // don't delay
return suspendCancellableCoroutine { scheduleResumeAfterDelay(time, it) }
Expand Down
1 change: 0 additions & 1 deletion ui/kotlinx-coroutines-javafx/src/JavaFxDispatcher.kt
Expand Up @@ -10,7 +10,6 @@ import javafx.event.*
import javafx.util.*
import kotlinx.coroutines.*
import kotlinx.coroutines.internal.*
import kotlinx.coroutines.javafx.JavaFx.delay
import java.lang.UnsupportedOperationException
import java.lang.reflect.*
import java.util.concurrent.*
Expand Down

0 comments on commit 6c6b717

Please sign in to comment.