kotlin.coroutines.suspendCoroutine の使用を報告し、kotlinx.coroutines 依存性が存在する場合は、kotlinx.coroutines.suspendCancellableCoroutine に置き換えることを提案します。
suspendCancellableCoroutine 変数は、構造化された並行処理と適切なリソース管理に重要なビルトインキャンセルサポートを提供します。
例:
suspend fun usage(): String {
return suspendCoroutine { continuation ->
continuation.resume("Hello!")
}
}
クイックフィックス適用後:
suspend fun usage(): String {
return suspendCancellableCoroutine { continuation ->
continuation.resume("Hello!")
}
}