Kotlin / kotlin-jupyter

Kotlin kernel for Jupyter/IPython
Apache License 2.0
1.12k stars 107 forks source link

Support executing suspend functions directly #340

Open soywiz opened 2 years ago

soywiz commented 2 years ago

Right now you have to call runBlocking { } manually, and it would be nice if that is not required

ileasile commented 2 years ago

Hi, @soywiz! It's now not available in Kotlin scripting, on which kernel is based on: https://youtrack.jetbrains.com/issue/KT-23212 Please keep track of this issue.

altavir commented 2 years ago

What is possible is to add a renderer for Job and Deferred objects, which invokes runBlocking under the hood. It is also possible to add a Notebook-wide scope instead of Global and add a top-level launch extension. It was briefly discussed in #239. I can implement the corresponding plugin if anybody is interested.