Hey all, for a personal project I implemented a `S...
# coroutines
Hey all, for a personal project I implemented a
class which allows you to invoke a
suspendingAction { }
block as a coroutine replacement for
asyncAction { }
(i.e. the block gives you a CoroutineScope for invoking suspending functions). It also auto-cancels launched coroutines if the view is undocked. Is this something anyone else would be interested in? If so, what’s the best way to contribute this back to the TornadoFX project? Here’s the current implementation in my project: https://github.com/emanguy/GitlabTimeTracker/blob/master/src/main/kotlin/ui/util/SuspendingView.kt And here’s somewhere I use it to call suspending functions: https://github.com/emanguy/GitlabTimeTracker/blob/master/src/main/kotlin/ui/view/LoginView.kt#L33 Slack Conversation
tornadoFX does not use coroutines by design. It is quite easy to integrate coroutines in it by using coroutines-fx micro-library. So I do not think it makes sense to include it inside. A side library should be OK.