Does Objectify/Datastore Block or Suspend a Kotlin Coroutine?

70 views Asked by At

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.

1

There are 1 answers

2
stickfigure On BEST ANSWER

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.