Hi, I was wondering, some poeple using ktor on GAE...
# server
z
Hi, I was wondering, some poeple using ktor on GAE? I mean i checked demo on ktor.io but i would love to see "proper way" to acces datastore, use ofy or not, etc etc not to reinvent myslef 🙂 ?
m
I’m running a ktor project on GAE, but I’m not using their datastore. I’m just using it as a (mostly) convenient way to have the app logic running somewhere.
Also, see #ktor.
g
We use Ktor on GAE with Datastore , though without ofy.
In order to access entites, we ended up using an abstract class which provides property delegates that allow interaction with an underlying datastore Entity object
Something similar to this library (which I've never used): https://github.com/SamChou19815/typed-store
z
Hmm and can I ask.. do you call datastore methods in blocking way? or you ue suspend around?
g
Blocking, through a regular
DatastoreService
instead of
AsyncDatastoreService
z
ah.. I was so curious on this usage :)) like corutine wise style 🙂
b
Just pull in the
kotlinx-coroutines-jdk8
artifact and you can call
await()
on any
Future
that the
AsyncDatastoreService
returns