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

dsl: add Kotlin bus extensions #6

Open
lambdagg opened this issue Jul 6, 2022 · 2 comments
Open

dsl: add Kotlin bus extensions #6

lambdagg opened this issue Jul 6, 2022 · 2 comments
Assignees

Comments

@lambdagg
Copy link
Contributor

lambdagg commented Jul 6, 2022

We might need something like:

import wtf.mizu.kawa.OptimizedBus

fun main() {
    val bus = OptimizedBus()

    bus.addListener { 
        on<String> {
            println(it)
        }
    }

    val event = "foobar123"
    bus.publish(event)
}

and

import wtf.mizu.kawa.OptimizedBus

fun main() {
    val bus = OptimizedBus()

    bus.addListener<String> { 
        println(it)
    }

    val event = "foobar123"
    bus.publish(event)
}

or name the function whatever we want, like buildListener as @xtrm-en told me but that wouldn't really make sense as we're not only building it but also adding it directly.

@lambdagg
Copy link
Contributor Author

lambdagg commented Jul 6, 2022

As of #7, I think we could actually be making the dsl an actual dsl-only project by wrapping our future Java implementation.

@xtrm-en
Copy link
Member

xtrm-en commented Jul 7, 2022

first of all, fuck you.
second of all, yes.

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