Коммит 6b875dd8 создал по автору Sergey Mashkov's avatar Sergey Mashkov
Просмотр файлов

Upgrade kotlinx.coroutines

владелец 7092c307
version=0.9.2-SNAPSHOT
kotlin_version=1.2.41
coroutines_version=0.22.5
coroutines_version=0.23.0-dev-1
dokka_version=0.9.16
netty_version=4.1.24.Final
......
......@@ -72,8 +72,8 @@ private suspend fun CloseableHttpAsyncClient.sendRequest(
throw cause
}
continuation.invokeOnCompletion(onCancelling = true) { cause ->
cause ?: return@invokeOnCompletion
continuation.invokeOnCancellation { cause ->
cause ?: return@invokeOnCancellation
future.cancel(true)
parent.cancel(cause)
}
......
......@@ -5,6 +5,7 @@ import kotlinx.coroutines.experimental.internal.*
import java.time.*
import kotlin.coroutines.experimental.*
import kotlin.coroutines.experimental.intrinsics.*
import kotlin.jvm.*
/**
* It provides ability to cancel jobs and schedule coroutine with timeout. Unlike regular withTimeout
......@@ -80,7 +81,7 @@ class WeakTimeoutQueue(private val timeoutMillis: Long,
c.isCompleted -> suspended
result is CompletedExceptionally -> {
handle.dispose()
throw result.exception
throw result.cause
}
else -> {
handle.dispose()
......
......@@ -8,6 +8,7 @@ import java.nio.channels.*
import java.util.concurrent.atomic.*
import kotlin.coroutines.experimental.*
import kotlin.coroutines.experimental.intrinsics.*
import kotlin.jvm.*
class ActorSelectorManager(dispatcher: CoroutineDispatcher) : SelectorManagerSupport(), Closeable {
@Volatile
......
......@@ -17,7 +17,7 @@ abstract class SelectorManagerSupport internal constructor() : SelectorManager {
suspendCancellableCoroutine<Unit> { c ->
// val c = base.tracked() // useful for debugging
c.disposeOnCancel(selectable)
c.disposeOnCancellation(selectable)
selectable.suspensions.addSuspension(interest, c)
if (!c.isCancelled) {
......@@ -141,10 +141,6 @@ abstract class SelectorManagerSupport internal constructor() : SelectorManager {
}
}
internal fun CancellableContinuation<*>.disposeOnCancel(disposableHandle: DisposableHandle) {
invokeOnCompletion { if (isCancelled) disposableHandle.dispose() }
}
private var SelectionKey.subject: Selectable?
get() = attachment() as? Selectable
set(newValue) {
......
......@@ -53,7 +53,7 @@ private class CoroutineListener<T, F : Future<T>>(private val future: F,
private val exception: (Throwable, Continuation<T>) -> Unit
) : GenericFutureListener<F>, DisposableHandle {
init {
continuation.disposeOnCompletion(this)
continuation.disposeOnCancellation(this)
}
override fun operationComplete(future: F) {
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать