Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coroutines #16

Open
msink opened this issue Nov 28, 2018 · 6 comments
Open

Coroutines #16

msink opened this issue Nov 28, 2018 · 6 comments

Comments

@msink
Copy link
Owner

msink commented Nov 28, 2018

Need to integrate coroutines support from
https://github.com/Kotlin/kotlinx.coroutines/tree/master/native
and add sample similar to timer but based on coroutines.

@abbas-oveissi
Copy link

abbas-oveissi commented Aug 5, 2019

Is it possible to use Coroutines with Kotlin-libui in Linux application?
My code doesn't work.

fun main() = runBlocking {
    appWindow(
            title = "Coroutine",
            width = 500,
            height = 500
    ) {
        vbox {
            button("Launch Coroutine") {
                action {
                    async(Dispatchers.Main) {
                        printSomething()
                    }
                }
            }
        }
    }
}

suspend fun printSomething() {
    println("Run");
}

@Dominaezzz
Copy link

How does it not work?

@abbas-oveissi
Copy link

When I click on the Button, nothing happens. After closing the Box, "Run" is printed.

@Dominaezzz
Copy link

Dominaezzz commented Aug 5, 2019

Dispatchers.Main hasn't been implemented yet for kotlin-libui.

@abbas-oveissi
Copy link

Is it difficult to implement it myself? do you have any resources or sample code?

@Dominaezzz
Copy link

You can implement you own Dispatcher. This might help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants