Skip to content

Commit

Permalink
fix(kotlin): use runBlocking in executeBlocking instead of piggy back…
Browse files Browse the repository at this point in the history
…ing off of executeAsync
mehcode committed Jun 9, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 92da702 commit 9246d5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdk/kotlin/src/main/kotlin/com/hedera/hashgraph/sdk/Query.kt
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.annotation.JsonTypeInfo
import com.fasterxml.jackson.core.JsonProcessingException
import com.fasterxml.jackson.databind.ObjectMapper
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.future.future
import kotlinx.coroutines.runBlocking
import java.util.concurrent.CompletableFuture
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
@@ -60,6 +60,6 @@ open class Query<Response> protected constructor(private val responseClass: Clas

@JvmName("execute")
fun executeBlocking(client: Client): Response {
return executeAsync(client).get()
return runBlocking { execute(client) }
}
}

0 comments on commit 9246d5a

Please sign in to comment.