Sorry if this is basic question (and hopefully rig...
# datascience
j
Sorry if this is basic question (and hopefully right place to ask it) but is there way to call suspend functions in a Kotlin Notebook?
hmm, I guess I can just use something like
GlobalScope.launch
?
r
Yep, currently, you have to wrap then in 'runBlocking' context. We'll change it for K2
a
Use
GlobalScope.launch
if you want the asynchronous job handle or
runBlocking
. It is possible to add scope to notebook state or even add it as an implicit receiver, but it does not simplify things a lot.
j
Thanks, ended up using
runBlocking
👍 e.g. https://twitter.com/joreilly/status/1678008606258495488?s=20