Library initialization #603
Replies: 1 comment
-
Hi @steamstreetjon, thanks for the question. The example code you provided is the preferred way to synchronously call one of our I'd like to understand more about what you find cumbersome with the |
Beta Was this translation helpful? Give feedback.
-
Typically in Lambda, we initialize service objects outside of the main handler. In the Java SDK, this means just creating a client like:
But for Kotlin, we are using the
fromEnvironment
call, which is suspended, so we can't just call it, and have to wrap it in some kind of coroutine context, which means something like:This is fine, but pretty cumbersome. Is there a preferred way to do something like this that doesn't require the runBlocking?
Beta Was this translation helpful? Give feedback.
All reactions