Rename suspend to awaitSuspend

Ideally I'd like to just call this await, but it conflicts with an
existing method.

Signed-off-by: Graham <gpe@openrs2.org>
pull/132/head
Graham 3 years ago
parent 29ac56fe1e
commit e0a9bc3ca6
  1. 4
      archive/src/main/kotlin/org/openrs2/archive/cache/CacheDownloader.kt
  2. 2
      net/src/main/kotlin/dev/openrs2/net/FutureExtensions.kt

@ -1,7 +1,7 @@
package org.openrs2.archive.cache
import dev.openrs2.net.BootstrapFactory
import dev.openrs2.net.suspend
import dev.openrs2.net.awaitSuspend
import javax.inject.Inject
import javax.inject.Singleton
import kotlin.coroutines.suspendCoroutine
@ -22,7 +22,7 @@ public class CacheDownloader @Inject constructor(
.connect(hostname, port)
}
} finally {
group.shutdownGracefully().suspend()
group.shutdownGracefully().awaitSuspend()
}
}
}

@ -5,7 +5,7 @@ import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine
public suspend fun <V> Future<V>.suspend(): V {
public suspend fun <V> Future<V>.awaitSuspend(): V {
if (isDone) {
if (isSuccess) {
return now

Loading…
Cancel
Save