Search code examples
kotlingoogle-cloud-datastorekotlin-coroutinesobjectify

Does Objectify/Datastore Block or Suspend a Kotlin Coroutine?


I have a Kotlin/Ktor embeddedServer running under Google's "Cloud Run" that uses Objectify to access the Datastore when answering requests.

When a load/save now() call is made via Objectify, does it block or suspend the coroutine serving the request?

Given that Objectify is Java, my guess is that it blocks but I haven't been able to find a definitive answer on the subject.


Solution

  • It blocks. Also, all of the async behavior is fictional. It worked in v5, but the underlying Google APIs that v6 use are not async. The async flavor of Objectify's API is preserved for backwards compatibility (and future-proofing in case Google adds async to the low level api) but every fetch blocks.